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