Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
titleOutput
02.04.2020 10:33:29

duration

Format given duration.

{{duration <duration> [format]}}

Example

Code Block
titleTemplate
{{duration duration}}

...

Code Block
titleOutput
00:00:10

durationHumanize

Format a given duration in a human readable format.

{{durationHumanize <duration>}}

  • duration must be a valid input for moment.duration(). When using timestamps it must be in milliseconds.

Example

Code Block
titleTemplate
{{durationHumanize data.duration}}

...

Code Block
titleOutput
10 seconds

durationAs

Get a given duration in a certain unit of time.

{{durationAs <duration> [unit_of_time]}}

Example

Code Block
titleTemplate
{{durationAs data.duration "milliseconds"}}

...

Code Block
titleOutput
10000


fromNow

Display the time between now and a given time. See also: moment().fromNow().

{{fromNow <date>}}

  • date must be a valid input for moment(). When using timestamps it must be in milliseconds.

Example

Code Block
titleTemplate
{{fromNow data.time}}

...

Code Block
titleOutput
3 days ago


typeof

Display the js type of a value. Useful for debugging.

{{typeof <value>}}

  • date must be a valid input for moment(). When using timestamps it must be in milliseconds.

Example

Code Block
titleTemplate
{{typeof data.value}}

...

Code Block
titleOutput
number


toFixed (number of decimals)

Display a number with given amount of decimal places. For more advanced formatting see numberFormat.

{{toFixed <value> [decimals]}}

  • decimals number of decimal places (Default: 2)

Example

Code Block
titleTemplate
{{toFixed data.value 3}}

...

Code Block
titleOutput
1.234


numberFormat

Format a number.

{{numberFormat <value> [options]}}

options:

  • thousandsSep separator between 3 digits (Default: locale dependent)
  • decimalSep decimal separator (Default: locale dependent)
  • decimals number of decimal places (Default: 2)

Example

Code Block
titleTemplate

...

Code Block
titleOutput
1.024,23


Math: ceil, floor, div, max

Mathematical operations.

  • {{ceil <value>}} round up to integer
  • {{floor <value>}} round down to integer
  • {{div <nom> <denom>}} returns nom / denom
  • {{max <list> [property_path]}} returns the biggest element from the list. Compares the given property_path.

Boolean operations

Boolean operations, useful for #if conditions.

  • {{not <value>}} negate the value
  • {{eq <v1> <v2>}} v1 == v2
  • {{lt <v1> <v2>}} v1 < v2
  • {{lte <v1> <v2>}} v1 <= v2
  • {{gt <v1> <v2>}} v1 > v2
  • {{gte <v1> <v2>}} v1 >= v2

icon

Render an Icon

{{icon <name> [category]}}

  • name name of the icon. Find all icons here: SLDS Icons
  • category category of the icon (Default: "utility").