@thi.ng/date 2.7.8 → 2.7.10
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 +7 -1
- package/format.js +3 -4
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2024-03-
|
|
3
|
+
- **Last updated**: 2024-03-18T08:40:00Z
|
|
4
4
|
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
|
|
5
5
|
|
|
6
6
|
All notable changes to this project will be documented in this file.
|
|
@@ -9,6 +9,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
|
|
|
9
9
|
**Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
|
|
10
10
|
and/or version bumps of transitive dependencies.
|
|
11
11
|
|
|
12
|
+
### [2.7.9](https://github.com/thi-ng/umbrella/tree/@thi.ng/date@2.7.9) (2024-03-18)
|
|
13
|
+
|
|
14
|
+
#### ♻️ Refactoring
|
|
15
|
+
|
|
16
|
+
- update defFormat() internals ([cf5890c](https://github.com/thi-ng/umbrella/commit/cf5890c))
|
|
17
|
+
|
|
12
18
|
## [2.7.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/date@2.7.0) (2024-02-22)
|
|
13
19
|
|
|
14
20
|
#### 🚀 Features
|
package/format.js
CHANGED
|
@@ -154,10 +154,9 @@ const FORMATTERS = {
|
|
|
154
154
|
const defFormat = (fmt) => (x = Date.now(), utc = false) => {
|
|
155
155
|
let d = ensureDate(x);
|
|
156
156
|
utc && (d = new Date(d.getTime() + d.getTimezoneOffset() * MINUTE));
|
|
157
|
-
return fmt.map(
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
}).join("");
|
|
157
|
+
return fmt.map(
|
|
158
|
+
(x2) => isString(x2) ? x2.startsWith("\\") ? x2.substring(1) : FORMATTERS[x2]?.(d, utc) ?? x2 : isFunction(x2) ? x2(d, utc) : x2
|
|
159
|
+
).join("");
|
|
161
160
|
};
|
|
162
161
|
const FMT_yyyyMMdd = defFormat(["yyyy", "-", "MM", "-", "dd"]);
|
|
163
162
|
const FMT_yyyyMMdd_ALT = defFormat(["yyyy", "MM", "dd"]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/date",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.10",
|
|
4
4
|
"description": "Datetime types, relative dates, math, iterators, composable formatters, locales",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@thi.ng/api": "^8.9.30",
|
|
40
|
-
"@thi.ng/checks": "^3.5.
|
|
41
|
-
"@thi.ng/strings": "^3.7.
|
|
40
|
+
"@thi.ng/checks": "^3.5.4",
|
|
41
|
+
"@thi.ng/strings": "^3.7.26"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@microsoft/api-extractor": "^7.42.3",
|
|
@@ -133,5 +133,5 @@
|
|
|
133
133
|
"thi.ng": {
|
|
134
134
|
"year": 2020
|
|
135
135
|
},
|
|
136
|
-
"gitHead": "
|
|
136
|
+
"gitHead": "da965520b2f3f8c259a791e8e8864308be2ba0be\n"
|
|
137
137
|
}
|