nw-skeleton

Namespace: appMethods

mixins. appMethods

mixins.appMethods Application Vue global mixin appMethods namespace

Methods

addZeros(value, maxLength){string}

Parameters

Name Type Description
value mixed Starting value
maxLength string Maximum return value string length

Return

Adds zeros until value length is equal to maxLength

formatCurrency(price){string}

Parameters

Name Type Description
price Number Numeric price

Return

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

Return

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

Return

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

Return

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

Return

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

Return

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

Return

Format time normalized (Y-m-d H:i:s format)