NOTE!
- This parser will convert a duration time "
####y####d####h####m####s" into a sortable value. - It is not designed to convert
365days into1year, nor performo any other conversions. - Options:
durationLabels- Default:
'(?:years|year|y),(?:days|day|d),(?:hours|hour|h),(?:minutes|minute|min|m),(?:seconds|second|sec|s)' - Add more or change the duration labels by modifying this option; separate the labels with a comma.
- The label doesn't need to include regex. If you are only using one letter, change the label to
'y,d,h,m,s'
- Default:
durationLength- Default:
4 - Modify this value so that the max length of values is included.
- The default value of
4will include values up to9,999 - Values less than or equal to
99,999will require this option to be set to5 - Values less than or equal to
999,999need this value set to6, etc.
- Default:
Demo
parsed values within the column| Name | Duration |
|---|---|
| Frank | 1y 23d 12h 44m 9s |
| Fred | 12d 12h 14m 20s |
| Albert | 12h 14m 3s |
| Aaron | 3d 11h 13m 22s |
| Oliver | 3d 11h 14s |
| Xavier | 11m 41s |
| Henry | 12m |
| Lucy | 23d 12h 44m 10s |
| Marsha | 1y 1h 1m 1s |
| Pat | 12 days 12hours 44minutes 50 seconds |
| George | 33s |
| Oscar | 24d 12h 11m 11s |