javascript-time-ago 2.5.12 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -1
- package/README.md +462 -316
- package/bundle/javascript-time-ago.js +1 -1
- package/bundle/javascript-time-ago.js.map +1 -1
- package/bundle/javascript-time-ago.min.js +1 -1
- package/bundle/javascript-time-ago.min.js.map +1 -1
- package/commonjs/FullDateFormatter.js +72 -0
- package/commonjs/FullDateFormatter.js.map +1 -0
- package/commonjs/FullDateFormatter.test.js +26 -0
- package/commonjs/FullDateFormatter.test.js.map +1 -0
- package/commonjs/TimeAgo.js +208 -106
- package/commonjs/TimeAgo.js.map +1 -1
- package/commonjs/TimeAgo.test.js +95 -10
- package/commonjs/TimeAgo.test.js.map +1 -1
- package/commonjs/steps/getStepMinTime.js +26 -19
- package/commonjs/steps/getStepMinTime.js.map +1 -1
- package/commonjs/steps/getTimeToNextUpdate.js +10 -2
- package/commonjs/steps/getTimeToNextUpdate.js.map +1 -1
- package/commonjs/style/twitter.js +2 -3
- package/commonjs/style/twitter.js.map +1 -1
- package/commonjs/style/twitter.test.js +5 -2
- package/commonjs/style/twitter.test.js.map +1 -1
- package/full-date-formatter/index.cjs +4 -0
- package/full-date-formatter/index.cjs.js +9 -0
- package/full-date-formatter/index.d.ts +6 -0
- package/full-date-formatter/index.js +1 -0
- package/full-date-formatter/package.json +15 -0
- package/index.cjs +1 -1
- package/index.cjs.js +2 -2
- package/index.d.ts +14 -4
- package/index.js +3 -1
- package/modules/FullDateFormatter.js +67 -0
- package/modules/FullDateFormatter.js.map +1 -0
- package/modules/FullDateFormatter.test.js +22 -0
- package/modules/FullDateFormatter.test.js.map +1 -0
- package/modules/TimeAgo.js +208 -107
- package/modules/TimeAgo.js.map +1 -1
- package/modules/TimeAgo.test.js +95 -8
- package/modules/TimeAgo.test.js.map +1 -1
- package/modules/steps/getStepMinTime.js +26 -19
- package/modules/steps/getStepMinTime.js.map +1 -1
- package/modules/steps/getTimeToNextUpdate.js +10 -2
- package/modules/steps/getTimeToNextUpdate.js.map +1 -1
- package/modules/style/twitter.js +3 -3
- package/modules/style/twitter.js.map +1 -1
- package/modules/style/twitter.test.js +5 -2
- package/modules/style/twitter.test.js.map +1 -1
- package/package.json +16 -11
package/CHANGELOG.md
CHANGED
|
@@ -33,6 +33,15 @@ TO DO: "time" style should use "round" scale instead of "approximate".
|
|
|
33
33
|
TO DO: if `style` is passed as an object then maybe it should be passed as part of `options` (and document that in the "Custom" section of the readme).
|
|
34
34
|
-->
|
|
35
35
|
|
|
36
|
+
2.6.0 / 28.09.2025
|
|
37
|
+
==================
|
|
38
|
+
|
|
39
|
+
* Rewrote README.
|
|
40
|
+
* Added `refresh` parameter.
|
|
41
|
+
* `getTimeToNextUpdate: true` now returns a "capped" `timeToNextUpdate` by default — this is to work around `setTimeout()` [bug](https://stackoverflow.com/questions/3468607/why-does-settimeout-break-for-large-millisecond-delay-values) when the delay is longer than about `24.85` days.
|
|
42
|
+
* The new "capping" behavior could be disabled by passing `getTimeToNextUpdateUncapped: true` option.
|
|
43
|
+
* Added `javascript-time-ago/full-date-formatter` export — it can be used to get the value for the `title` attribute of a `<time/>` HTML tag.
|
|
44
|
+
|
|
36
45
|
2.4.0 / 19.05.2022
|
|
37
46
|
==================
|
|
38
47
|
|
|
@@ -117,7 +126,7 @@ TO DO: if `style` is passed as an object then maybe it should be passed as part
|
|
|
117
126
|
|
|
118
127
|
* Added `test(date, { now, future })` function to steps: it can be an alternative to `minTime`. See "twitter" style for an example.
|
|
119
128
|
|
|
120
|
-
* Added a third argument to steps' `format()` function: an object having shape `{ formatAs(unit,
|
|
129
|
+
* Added a third argument to steps' `format()` function: an object having shape `{ formatAs(unit, amount): string, future: boolean }`.
|
|
121
130
|
|
|
122
131
|
* Added `TimeAgo.addLabels(locale, name, labels)` function, that can be used to expand localized time labels.
|
|
123
132
|
|