javascript-time-ago
Advanced tools
Comparing version 0.4.1 to 0.4.2
{ | ||
"name": "javascript-time-ago", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"description": "International highly customizable relative time formatting", | ||
@@ -5,0 +5,0 @@ "main": "index.umd.js", |
@@ -126,3 +126,3 @@ # javascript-time-ago | ||
The time scale is (actually same as the default style but with "ago" omitted): | ||
The time scale is (actually the same as the default style but with "ago" omitted): | ||
@@ -204,3 +204,3 @@ * just now | ||
The `past` and `future` keys can be one of: `zero`, `one`, `two`, `few`, `many` and `other`. For more info of which is which read the [official Unicode CLDR documentation](http://cldr.unicode.org/index/cldr-spec/plural-rules). [Unicode CLDR][CLDR] (Common Locale Data Repository) is an industry standard and is basically a collection of formatting rules for all locales (date, time, currency, measurement units, numbers, etc). | ||
The `past` and `future` keys can be one of: `zero`, `one`, `two`, `few`, `many` and `other`. For more info on which is which read the [official Unicode CLDR documentation](http://cldr.unicode.org/index/cldr-spec/plural-rules). [Unicode CLDR][CLDR] (Common Locale Data Repository) is an industry standard and is basically a collection of formatting rules for all locales (date, time, currency, measurement units, numbers, etc). | ||
@@ -252,3 +252,3 @@ One can also use raw Unicode CLDR locale rules which will be automatically converted to the format described above. | ||
javascript_time_ago.locale('ru', russian.main.ru.dates.fields) | ||
javascript_time_ago.locale(russian) | ||
@@ -264,6 +264,6 @@ const time_ago = new javascript_time_ago('ru') | ||
But server side doesn't need code splitting, so to load all available locales in Node.js you can use this shortcut: | ||
But server side doesn't need code splitting, so to load all available locales in Node.js one can use this shortcut: | ||
```js | ||
// A faster way to load all the localization data for Node.js | ||
// A faster way to load all localization data for Node.js | ||
// (`intl-messageformat` will load everything automatically when run in Node.js) | ||
@@ -275,3 +275,3 @@ require('javascript-time-ago/load-all-locales') | ||
Localization data described in the above section can be further customized, for example, supporting "long" and "short" formats. Refer to [`locales/en.js`](https://github.com/halt-hammerzeit/javascript-time-ago/blob/master/locales/en.js) for an example. | ||
Localization data described in the above section can be further customized, for example, supporting `long` and `short` formats. Refer to [`locales/en.js`](https://github.com/halt-hammerzeit/javascript-time-ago/blob/master/locales/en.js) for an example. | ||
@@ -288,7 +288,7 @@ Built-in localization data is presented in different variants. Example: | ||
One can pass `options` as a second parameter to the `.format(date, options)` function. It's called a `style` (see "twitter" style for example). The `options` object can specify: | ||
One can pass `options` as a second parameter to the `.format(date, options)` function. It's called a `style` (see `twitter` style for example). The `options` object can specify: | ||
* `flavour` – preferred labels style (e.g. `tiny`, `short`, `long`) | ||
* `units` – a list of time interval measurement units which can be used in the formatted output (e.g. `['second', 'minute', 'hour']`) | ||
* `gradation` – custom time interval measurement units gradation | ||
* `gradation` – custom time interval measurement units scale | ||
* `override` – is a function of `{ elapsed, time, date, now }`. If the `override` function returns a value, then the `.format()` call will return that value. Otherwise it has no effect. | ||
@@ -295,0 +295,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
123876
22
2640