I am receiving a string in this format 'HH:mm:ss' and I need to get rid of the leading zeros OR convert it to minutes/hours. Is there a RegExp to achieve this?
Examples with no leading zeros:
00:03:15 => 3:15
10:10:10 => 10:10:10
00:00:00 => 0:00
04:00:00 => 4:00:00
00:42:32 => 42:32
00:00:18 => 0:18
00:00:08 => 0:08
Examples of time converted to minutes/hours
00:07:00 => 7 min
00:10:30 => 10:30 min
01:40:00 => 1h 40 min