META-INF.resources.bower_components.globalize.src.relative-time-runtime.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jwebmp-globalize Show documentation
Show all versions of jwebmp-globalize Show documentation
The JWebSwing implementation for a full Globalization
define([
"./common/runtime-key",
"./common/validate/parameter-presence",
"./common/validate/parameter-type/number",
"./core-runtime",
"./relative-time/formatter-fn",
"./number-runtime",
"./plural-runtime"
], function (runtimeKey, validateParameterPresence, validateParameterTypeNumber, Globalize,
relativeTimeFormatterFn) {
Globalize._relativeTimeFormatterFn = relativeTimeFormatterFn;
Globalize.formatRelativeTime =
Globalize.prototype.formatRelativeTime = function (value, unit, options) {
validateParameterPresence(value, "value");
validateParameterTypeNumber(value, "value");
return this.relativeTimeFormatter(unit, options)(value);
};
Globalize.relativeTimeFormatter =
Globalize.prototype.relativeTimeFormatter = function (unit, options) {
options = options || {};
return Globalize[runtimeKey("relativeTimeFormatter", this._locale, [unit, options])];
};
return Globalize;
});
© 2015 - 2025 Weber Informatics LLC | Privacy Policy