Remove empty hours, minutes or seconds from duration on toDate()

I have this field:

duration: 
  type: time 
  display: HH:mm:ss
  width: 1/4

That i use like this:

$element->duration()->toDate("H'h' m'm' ss''''")

But this results, sometimes in:

0h 10m 00''

Where I’d like this to happen:

10m

I assume I could break h m s into an associative array ['h' => 00, 'm' => 10, 's' => 0] then remove those that are 00, and echo the rest in the desired format, but … perhaps is there a standard way to deal with this, be it kirby time field or toDate() or php intl ?

Thank you

kirby uses Date() under the hood belive, so should be able to do an if statement to check if the hour and seconds is greater than 00 and output what you want accordingling

Something like this