Methods
addZeros(value, maxLength){string}
Parameters
| Name |
Type |
Description |
| value |
mixed
|
Starting value |
| maxLength |
string
|
Maximum return value string length |
Adds zeros until value length is equal to maxLength
basename(file){string}
Parameters
| Name |
Type |
Description |
| file |
string
|
File path |
Returns base name of the file
formatCurrency(price){string}
Parameters
| Name |
Type |
Description |
| price |
Number
|
Numeric price |
Formats currency based on current language locale
formatDate(date, options, includeTime){string}
Parameters
| Name |
Type |
Description |
| date |
Date
|
Date value to format |
| options |
Object
|
Date format options |
| includeTime |
Boolean
|
Flag to indicate whether to include time |
Formats date based on options
formatDateNormalize(date, options, includeTime, omitSeconds){string}
Parameters
| Name |
Type |
Description |
| date |
Date
|
Date value to format |
| options |
Object
|
Date format options |
| includeTime |
Boolean
|
Flag to indicate whether to include time |
| omitSeconds |
Boolean
|
Flag to indicate whether to omit seconds |
Format date normalized (Y-m-d H:i:s format)
formatDuration(duration, omitEmpty, omitZeros, roundDecimals, secondFractions){string}
Parameters
| Name |
Type |
Description |
| duration |
Number
|
Duration in milliseconds |
| omitEmpty |
Boolean
|
Flag to indicate whether to omit empty values |
| omitZeros |
Boolean
|
Flag to indicate whether to omit zeros in one-digit values |
| roundDecimals |
Boolean
|
Number
|
Toggle (and set decimals) for value rounding (seconds only) |
| secondFractions |
Boolean
|
Flag to indicate whether to display second fractions |
Formats duration to human-readable format
formatDurationCustom(time, format, returnObj){string|Object}
Parameters
| Name |
Type |
Description |
| time |
Number
|
Duration in milliseconds |
| format |
string
|
Format string |
| returnObj |
Boolean
|
Flag to indicate whether to return object or string |
Formats custom duration based on passed format argument
formatTime(date, options, includeDate){string}
Parameters
| Name |
Type |
Description |
| date |
Date
|
Date value to format |
| options |
Object
|
Date format options |
| includeDate |
Boolean
|
Flag to indicate whether to include date |
Formats time based on options
formatTimeNormalize(date, options, includeDate, omitSeconds){string}
Parameters
| Name |
Type |
Description |
| date |
Date
|
Date value to format |
| options |
Object
|
Date format options |
| includeDate |
Boolean
|
Flag to indicate whether to include date |
| omitSeconds |
Boolean
|
Flag to indicate whether to omit seconds |
Format time normalized (Y-m-d H:i:s format)