date-vir 5.1.3 → 5.1.4
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.
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.toRelativeString = void 0;
|
|
4
4
|
const common_1 = require("@augment-vir/common");
|
|
5
|
+
const run_time_assertions_1 = require("run-time-assertions");
|
|
5
6
|
const diff_dates_1 = require("../date-operations/diff-dates");
|
|
6
7
|
const duration_unit_1 = require("../duration/duration-unit");
|
|
7
8
|
const maxDurations = {
|
|
@@ -43,7 +44,7 @@ function toRelativeString({ fullDate, relativeTo, options = {}, }) {
|
|
|
43
44
|
const shouldUseJustNow = options.blockJustNow
|
|
44
45
|
? false
|
|
45
46
|
: (unitToUse == undefined && allUnitDiffs.minutes < 2) ||
|
|
46
|
-
(0,
|
|
47
|
+
(0, run_time_assertions_1.isJsonEqual)(fullDate, relativeTo) ||
|
|
47
48
|
(unitToUse === duration_unit_1.DurationUnit.Minutes &&
|
|
48
49
|
options.blockedRelativeUnits?.includes(duration_unit_1.DurationUnit.Seconds) &&
|
|
49
50
|
allUnitDiffs.minutes < 2) ||
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { mapObjectValues, round } from '@augment-vir/common';
|
|
2
|
+
import { isJsonEqual } from 'run-time-assertions';
|
|
2
3
|
import { DiffType, diffDates } from '../date-operations/diff-dates';
|
|
3
4
|
import { DurationUnit, orderedDurationUnits, singularDurationUnitNames, } from '../duration/duration-unit';
|
|
4
5
|
const maxDurations = {
|
|
@@ -40,7 +41,7 @@ export function toRelativeString({ fullDate, relativeTo, options = {}, }) {
|
|
|
40
41
|
const shouldUseJustNow = options.blockJustNow
|
|
41
42
|
? false
|
|
42
43
|
: (unitToUse == undefined && allUnitDiffs.minutes < 2) ||
|
|
43
|
-
|
|
44
|
+
isJsonEqual(fullDate, relativeTo) ||
|
|
44
45
|
(unitToUse === DurationUnit.Minutes &&
|
|
45
46
|
options.blockedRelativeUnits?.includes(DurationUnit.Seconds) &&
|
|
46
47
|
allUnitDiffs.minutes < 2) ||
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "date-vir",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.4",
|
|
4
4
|
"description": "Easy and explicit dates and times",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"date",
|
|
@@ -41,26 +41,26 @@
|
|
|
41
41
|
"test:watch": "web-test-runner --watch --color --config configs/web-test-runner.config.mjs"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@augment-vir/common": "^
|
|
44
|
+
"@augment-vir/common": "^26.3.2",
|
|
45
45
|
"@types/luxon": "^3.4.2",
|
|
46
46
|
"luxon": "^3.4.4",
|
|
47
47
|
"object-shape-tester": "^2.3.2",
|
|
48
|
-
"type-fest": "^4.
|
|
48
|
+
"type-fest": "^4.15.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@augment-vir/browser": "^
|
|
52
|
-
"@augment-vir/browser-testing": "^
|
|
51
|
+
"@augment-vir/browser": "^26.3.2",
|
|
52
|
+
"@augment-vir/browser-testing": "^26.3.2",
|
|
53
53
|
"@open-wc/testing": "^4.0.0",
|
|
54
|
-
"@types/chai": "^4.3.
|
|
54
|
+
"@types/chai": "^4.3.14",
|
|
55
55
|
"@types/mocha": "^10.0.6",
|
|
56
56
|
"@web/dev-server-esbuild": "^1.0.2",
|
|
57
57
|
"@web/test-runner": "^0.18.1",
|
|
58
58
|
"@web/test-runner-commands": "^0.9.0",
|
|
59
59
|
"@web/test-runner-playwright": "^0.11.0",
|
|
60
60
|
"@web/test-runner-visual-regression": "^0.9.0",
|
|
61
|
-
"cspell": "^8.
|
|
62
|
-
"dependency-cruiser": "^16.
|
|
63
|
-
"element-vir": "^
|
|
61
|
+
"cspell": "^8.7.0",
|
|
62
|
+
"dependency-cruiser": "^16.3.0",
|
|
63
|
+
"element-vir": "^22.1.0",
|
|
64
64
|
"esbuild": "^0.20.2",
|
|
65
65
|
"istanbul-smart-text-reporter": "^1.1.4",
|
|
66
66
|
"markdown-code-example-inserter": "^1.0.0",
|
|
@@ -70,12 +70,12 @@
|
|
|
70
70
|
"prettier-plugin-jsdoc": "^1.3.0",
|
|
71
71
|
"prettier-plugin-multiline-arrays": "^3.0.4",
|
|
72
72
|
"prettier-plugin-organize-imports": "^3.2.4",
|
|
73
|
-
"prettier-plugin-packagejson": "^2.
|
|
74
|
-
"prettier-plugin-sort-json": "^
|
|
73
|
+
"prettier-plugin-packagejson": "^2.5.0",
|
|
74
|
+
"prettier-plugin-sort-json": "^4.0.0",
|
|
75
75
|
"prettier-plugin-toml": "^2.0.1",
|
|
76
|
-
"run-time-assertions": "^1.
|
|
77
|
-
"typedoc": "^0.25.
|
|
78
|
-
"typescript": "^5.4.
|
|
79
|
-
"virmator": "^11.
|
|
76
|
+
"run-time-assertions": "^1.2.0",
|
|
77
|
+
"typedoc": "^0.25.13",
|
|
78
|
+
"typescript": "^5.4.5",
|
|
79
|
+
"virmator": "^11.5.2"
|
|
80
80
|
}
|
|
81
81
|
}
|