-
- NOTE! -
-
-
- This parser will convert a duration time "
####
y####
d####
h####
m####
s" into a sortable value.
- - It is not designed to convert
365
days into1
year, nor perform 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
4
will include values up to9,999
- - Values less than or equal to
99,999
will require this option to be set to5
- - Values less than or equal to
999,999
need this value set to6
, etc.
-
- - Default:
-
+
+
Notes
+
+
+ -
+
- Both the duration & countdown parsers are contained in the
parser-duration.js
file.
+ - Neither parser checks for valid time settings, all it does is parse the values to make them sortable. +
Duration Parser
+
+
+ -
+
- The duration parser will convert a duration time "
####
y####
d####
h####
m####
s" into a sortable value.
+ - It is not designed to convert
365
days into1
year, nor perform 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
4
will include values up to9,999
+ - Values less than or equal to
99,999
will require this option to be set to5
+ - Values less than or equal to
999,999
need this value set to6
, etc.
+
+ - Default:
+
Countdown Parser
+
+
+ -
+
- The countdown parser will convert a countdown time "
####
:####
:####
" into a sortable value.
+ - It is not designed to deal with invalid times like
65:99
(65 minutes & 99 seconds).
+ - This parser also uses the
durantionLength
value to set the maximum length of each value used in the countdown. +-
+
- Default:
4
+ - Modify this value so that the max length of values is included. +
- The default value of
4
will include values up to9,999
+ - Values less than or equal to
99,999
will require this option to be set to5
+ - Values less than or equal to
999,999
need this value set to6
, etc.
+
+ - Default: