Es ist möglich, allen Termin-Einladungen auf einmal zuzusagen MoK: DevExpress von Version 17.1 auf 21.1 aktualisiert Reports testweise eingebaut DevExpress-Scheduler testweise eingebaut
1.4 KiB
.relativeTimeFormatter( unit [, options] ) ➜ function( value )
Returns a function that formats a relative time according to the given unit, options, and the default/instance locale.
The returned function is invoked with one argument: the number value to be formatted.
Parameters
unit
String value indicating the unit to be formatted. eg. "day", "week", "month", etc.
options.form
String, e.g., "short" or "narrow", or falsy for default long form.
value
The number to be formatted.
Example
Prior to using any relative time methods, you must load cldr/main/{locale}/dateFields.json and the CLDR content required by the number and plural modules. Read CLDR content if you need more information.
You can use the static method Globalize.relativeTimeFormatter(), which uses the default locale.
var formatter;
Globalize.locale( "en" );
formatter = Globalize.relativeTimeFormatter( "month" );
formatter( 1 );
// > "next month"
formatter( 3 );
// > "in 3 months"
formatter( -1 );
// > "last month"
formatter( -3 );
// > "3 months ago"
You can use the instance method .relativeTimeFormatter(), which uses the instance locale.
var globalize = new Globalize( "en" ),
formatter = globalize.relativeTimeFormatter( "week" );
formatter( 1 );
// > "next week"