@thi.ng/date 2.7.82 → 2.8.0
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/README.md +21 -19
- package/api.d.ts +6 -0
- package/datetime.d.ts +1 -1
- package/format.js +10 -6
- package/i18n/en.js +0 -1
- package/i18n.js +1 -0
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<!-- This file is generated - DO NOT EDIT! -->
|
|
2
|
-
<!-- Please see: https://
|
|
3
|
-
# 
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@thi.ng/date)
|
|
6
6
|

|
|
@@ -8,11 +8,12 @@
|
|
|
8
8
|
|
|
9
9
|
> [!NOTE]
|
|
10
10
|
> This is one of 214 standalone projects, maintained as part
|
|
11
|
-
> of the [@thi.ng/umbrella](https://
|
|
11
|
+
> of the [@thi.ng/umbrella](https://codeberg.org/thi.ng/umbrella/) ecosystem
|
|
12
12
|
> and anti-framework.
|
|
13
13
|
>
|
|
14
|
-
> 🚀 Please help me to work full-time on these projects by [sponsoring
|
|
15
|
-
>
|
|
14
|
+
> 🚀 Please help me to work full-time on these projects by [sponsoring
|
|
15
|
+
> me](https://codeberg.org/thi.ng/umbrella/src/branch/develop/CONTRIBUTING.md#donations).
|
|
16
|
+
> Thank you! ❤️
|
|
16
17
|
|
|
17
18
|
- [About](#about)
|
|
18
19
|
- [Status](#status)
|
|
@@ -40,7 +41,7 @@ Datetime types, relative dates, math, iterators, composable formatters, locales.
|
|
|
40
41
|
|
|
41
42
|
**STABLE** - used in production
|
|
42
43
|
|
|
43
|
-
[Search or submit any issues for this package](https://
|
|
44
|
+
[Search or submit any issues for this package](https://codeberg.org/thi.ng/umbrella/issues?q=%5Bdate%5D)
|
|
44
45
|
|
|
45
46
|
## Installation
|
|
46
47
|
|
|
@@ -68,29 +69,29 @@ For Node.js REPL:
|
|
|
68
69
|
const date = await import("@thi.ng/date");
|
|
69
70
|
```
|
|
70
71
|
|
|
71
|
-
Package sizes (brotli'd, pre-treeshake): ESM: 5.
|
|
72
|
+
Package sizes (brotli'd, pre-treeshake): ESM: 5.43 KB
|
|
72
73
|
|
|
73
74
|
## Dependencies
|
|
74
75
|
|
|
75
|
-
- [@thi.ng/api](https://
|
|
76
|
-
- [@thi.ng/checks](https://
|
|
77
|
-
- [@thi.ng/strings](https://
|
|
76
|
+
- [@thi.ng/api](https://codeberg.org/thi.ng/umbrella/src/branch/develop/packages/api)
|
|
77
|
+
- [@thi.ng/checks](https://codeberg.org/thi.ng/umbrella/src/branch/develop/packages/checks)
|
|
78
|
+
- [@thi.ng/strings](https://codeberg.org/thi.ng/umbrella/src/branch/develop/packages/strings)
|
|
78
79
|
|
|
79
80
|
Note: @thi.ng/api is in _most_ cases a type-only import (not used at runtime)
|
|
80
81
|
|
|
81
82
|
## Usage examples
|
|
82
83
|
|
|
83
84
|
Five projects in this repo's
|
|
84
|
-
[/examples](https://
|
|
85
|
+
[/examples](https://codeberg.org/thi.ng/umbrella/src/branch/develop/examples)
|
|
85
86
|
directory are using this package:
|
|
86
87
|
|
|
87
|
-
| Screenshot | Description | Live demo | Source
|
|
88
|
-
|
|
89
|
-
| <img src="https://
|
|
90
|
-
| <img src="https://
|
|
91
|
-
| <img src="https://
|
|
92
|
-
| <img src="https://
|
|
93
|
-
| <img src="https://
|
|
88
|
+
| Screenshot | Description | Live demo | Source |
|
|
89
|
+
|:----------------------------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------|:-----------------------------------------------------|:------------------------------------------------------------------------------------------|
|
|
90
|
+
| <img src="https://codeberg.org/thi.ng/umbrella/media/branch/develop/assets/examples/commit-heatmap.png" width="240"/> | Heatmap visualization of this mono-repo's commits | | [Source](https://codeberg.org/thi.ng/umbrella/src/branch/develop/examples/commit-heatmap) |
|
|
91
|
+
| <img src="https://codeberg.org/thi.ng/umbrella/media/branch/develop/assets/examples/csp-bus.png" width="240"/> | CSP channel-based event handling, async transducers & reactive UI components | [Demo](https://demo.thi.ng/umbrella/csp-bus/) | [Source](https://codeberg.org/thi.ng/umbrella/src/branch/develop/examples/csp-bus) |
|
|
92
|
+
| <img src="https://codeberg.org/thi.ng/umbrella/media/branch/develop/assets/examples/mastodon-feed.jpg" width="240"/> | Mastodon API feed reader with support for different media types, fullscreen media modal, HTML rewriting | [Demo](https://demo.thi.ng/umbrella/mastodon-feed/) | [Source](https://codeberg.org/thi.ng/umbrella/src/branch/develop/examples/mastodon-feed) |
|
|
93
|
+
| <img src="https://codeberg.org/thi.ng/umbrella/media/branch/develop/assets/examples/pointfree-geom.jpg" width="240"/> | Live coding playground for 2D geometry generation using @thi.ng/pointfree-lang | [Demo](https://demo.thi.ng/umbrella/pointfree-geom/) | [Source](https://codeberg.org/thi.ng/umbrella/src/branch/develop/examples/pointfree-geom) |
|
|
94
|
+
| <img src="https://codeberg.org/thi.ng/umbrella/media/branch/develop/assets/examples/zig-todo-list.png" width="240"/> | Zig-based To-Do list, DOM creation, local storage task persistence | [Demo](https://demo.thi.ng/umbrella/zig-todo-list/) | [Source](https://codeberg.org/thi.ng/umbrella/src/branch/develop/examples/zig-todo-list) |
|
|
94
95
|
|
|
95
96
|
## API
|
|
96
97
|
|
|
@@ -215,7 +216,7 @@ asDays(absDifference("2020-02", "2021-02"))
|
|
|
215
216
|
Several iterators are provided to produce timestamps of various granularities
|
|
216
217
|
between two given dates. Originally, these were intended for visualization
|
|
217
218
|
purposes (i.e. as axis tick label generators for
|
|
218
|
-
[@thi.ng/viz](https://
|
|
219
|
+
[@thi.ng/viz](https://codeberg.org/thi.ng/umbrella/src/branch/develop/packages/viz)).
|
|
219
220
|
|
|
220
221
|
- `years()`
|
|
221
222
|
- `querters()`
|
|
@@ -380,6 +381,7 @@ string literal, prefix the term with `\\`.
|
|
|
380
381
|
| `/DM` | Locale-specific day-month separator |
|
|
381
382
|
| `/MY` | Locale-specific month-year separator |
|
|
382
383
|
| `/HM` | Locale-specific hour-minute separator |
|
|
384
|
+
| `/MS` | Locale-specific minute-second separator |
|
|
383
385
|
|
|
384
386
|
<small>(Format IDs somewhat based on Java's
|
|
385
387
|
[SimpleDateFormat](https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/text/SimpleDateFormat.html))</small>
|
package/api.d.ts
CHANGED
package/datetime.d.ts
CHANGED
|
@@ -118,5 +118,5 @@ export declare const ensureDateTime: (x: MaybeDate, prec?: Precision) => DateTim
|
|
|
118
118
|
*
|
|
119
119
|
* @param x -
|
|
120
120
|
*/
|
|
121
|
-
export declare const maybeIsDate: (x: any) => x is string | number |
|
|
121
|
+
export declare const maybeIsDate: (x: any) => x is string | number | Date | DateTime;
|
|
122
122
|
//# sourceMappingURL=datetime.d.ts.map
|
package/format.js
CHANGED
|
@@ -146,6 +146,10 @@ const FORMATTERS = {
|
|
|
146
146
|
* Current {@link LOCALE}'s hour-minute separator.
|
|
147
147
|
*/
|
|
148
148
|
"/HM": () => LOCALE.sepHM,
|
|
149
|
+
/**
|
|
150
|
+
* Current {@link LOCALE}'s minute-second separator.
|
|
151
|
+
*/
|
|
152
|
+
"/MS": () => LOCALE.sepMS,
|
|
149
153
|
/**
|
|
150
154
|
* Current {@link LOCALE}'s month-year separator.
|
|
151
155
|
*/
|
|
@@ -162,13 +166,13 @@ const FMT_yyyyMMdd = defFormat(["yyyy", "-", "MM", "-", "dd"]);
|
|
|
162
166
|
const FMT_yyyyMMdd_ALT = defFormat(["yyyy", "MM", "dd"]);
|
|
163
167
|
const FMT_Mdyyyy = defFormat(["M", "/", "d", "/", "yyyy"]);
|
|
164
168
|
const FMT_MMMdyyyy = defFormat(["MMM", " ", "d", " ", "yyyy"]);
|
|
165
|
-
const FMT_dMyyyy = defFormat(["d", "
|
|
166
|
-
const FMT_dMMMyyyy = defFormat(["d", "
|
|
167
|
-
const FMT_HHmm = defFormat(["HH", "
|
|
168
|
-
const FMT_hm = defFormat(["h", "
|
|
169
|
-
const FMT_HHmmss = defFormat(["HH", "
|
|
169
|
+
const FMT_dMyyyy = defFormat(["d", "/DM", "M", "/MY", "yyyy"]);
|
|
170
|
+
const FMT_dMMMyyyy = defFormat(["d", "/DM", "MMM", " ", "yyyy"]);
|
|
171
|
+
const FMT_HHmm = defFormat(["HH", "/HM", "mm"]);
|
|
172
|
+
const FMT_hm = defFormat(["h", "/HM", "mm", " ", "A"]);
|
|
173
|
+
const FMT_HHmmss = defFormat(["HH", "/HM", "mm", "/MS", "ss"]);
|
|
170
174
|
const FMT_HHmmss_ALT = defFormat(["HH", "mm", "ss"]);
|
|
171
|
-
const FMT_hms = defFormat(["h", "
|
|
175
|
+
const FMT_hms = defFormat(["h", "/HM", "mm", "/MS", "ss", " ", "A"]);
|
|
172
176
|
const FMT_yyyyMMdd_HHmmss = defFormat(
|
|
173
177
|
["yyyy", "MM", "dd", "-", "HH", "mm", "ss"]
|
|
174
178
|
);
|
package/i18n/en.js
CHANGED
package/i18n.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/date",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.0",
|
|
4
4
|
"description": "Datetime types, relative dates, math, iterators, composable formatters, locales",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"sideEffects": false,
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "git+https://
|
|
11
|
+
"url": "git+https://codeberg.org/thi.ng/umbrella.git",
|
|
12
12
|
"directory": "packages/date"
|
|
13
13
|
},
|
|
14
14
|
"homepage": "https://thi.ng/date",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@thi.ng/api": "^8.12.
|
|
44
|
-
"@thi.ng/checks": "^3.8.
|
|
45
|
-
"@thi.ng/strings": "^3.11.
|
|
43
|
+
"@thi.ng/api": "^8.12.18",
|
|
44
|
+
"@thi.ng/checks": "^3.8.8",
|
|
45
|
+
"@thi.ng/strings": "^3.11.1"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"esbuild": "^0.27.2",
|
|
@@ -135,5 +135,5 @@
|
|
|
135
135
|
"thi.ng": {
|
|
136
136
|
"year": 2020
|
|
137
137
|
},
|
|
138
|
-
"gitHead": "
|
|
138
|
+
"gitHead": "4924437d79b0a602593f972b6537d8eba3e0b2ee\n"
|
|
139
139
|
}
|