Period
Somewhat of an odd feature. Converting a timespan into chunks.
Functions
Util.period
Definition
- Name
- Util.period
- Syntax
- String = Util.period( String format [, JSON time ] );
Description
Format time in a readable manner or convert time formats.
Parameters
- format
-
String Format setting for output
Options
- time
-
JSON Optional, JSON object with time argument
Options
One rules out the other, last entry counts.
Return values
String Formatted time string
Examples
u.period("m:s.u", {"seconds":13.31809});
Returns
u.period("D h:m:s.u", {"seconds":2013034.2347});
Returns
u.period("D", {"years":2});
Returns
u.period("H", {"months":4});
Returns
Dependencies
JavaScript
- typeof
- Switch ... case
- Math.floor
- Math.round
- String.replace
Manipulator
Nothing
Files
Main file
- u-period.js
Segment support files
- none
Segment dependencies
- desktop_edge
- u-period.js
- desktop_ie11
- u-period.js
- desktop
- u-period.js
- desktop_ie10
- u-period.js
- desktop_ie9
- u-period.js
- desktop_light
- u-period.js
- tablet
- u-period.js
- tablet_light
- u-period.js
- smartphone
- u-period.js
- mobile
- not tested
- mobile_light
- not tested
- tv
- u-period.js
- seo
- not supported