@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  <!-- This file is generated - DO NOT EDIT! -->
2
- <!-- Please see: https://github.com/thi-ng/umbrella/blob/develop/CONTRIBUTING.md#changes-to-readme-files -->
3
- # ![@thi.ng/date](https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/banners/thing-date.svg?6fafa39b)
2
+ <!-- Please see: https://codeberg.org/thi.ng/umbrella/src/branch/develop/CONTRIBUTING.md#changes-to-readme-files -->
3
+ # ![@thi.ng/date](https://codeberg.org/thi.ng/umbrella/media/branch/develop/assets/banners/thing-date.svg?6fafa39b)
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/@thi.ng/date.svg)](https://www.npmjs.com/package/@thi.ng/date)
6
6
  ![npm downloads](https://img.shields.io/npm/dm/@thi.ng/date.svg)
@@ -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://github.com/thi-ng/umbrella/) monorepo
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 me on
15
- > GitHub](https://github.com/sponsors/postspectacular). Thank you! ❤️
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://github.com/thi-ng/umbrella/issues?q=%5Bdate%5D+in%3Atitle)
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.42 KB
72
+ Package sizes (brotli'd, pre-treeshake): ESM: 5.43 KB
72
73
 
73
74
  ## Dependencies
74
75
 
75
- - [@thi.ng/api](https://github.com/thi-ng/umbrella/tree/develop/packages/api)
76
- - [@thi.ng/checks](https://github.com/thi-ng/umbrella/tree/develop/packages/checks)
77
- - [@thi.ng/strings](https://github.com/thi-ng/umbrella/tree/develop/packages/strings)
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://github.com/thi-ng/umbrella/tree/develop/examples)
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://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/commit-heatmap.png" width="240"/> | Heatmap visualization of this mono-repo's commits | | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/commit-heatmap) |
90
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/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://github.com/thi-ng/umbrella/tree/develop/examples/csp-bus) |
91
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/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://github.com/thi-ng/umbrella/tree/develop/examples/mastodon-feed) |
92
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/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://github.com/thi-ng/umbrella/tree/develop/examples/pointfree-geom) |
93
- | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/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://github.com/thi-ng/umbrella/tree/develop/examples/zig-todo-list) |
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://github.com/thi-ng/umbrella/tree/develop/packages/viz)).
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
@@ -92,6 +92,12 @@ export interface Locale {
92
92
  * @defaultValue ":"
93
93
  */
94
94
  sepHM: string;
95
+ /**
96
+ * Separator between minute & second
97
+ *
98
+ * @defaultValue ":"
99
+ */
100
+ sepMS: string;
95
101
  /**
96
102
  * Singular & plural versions of various date/time units.
97
103
  */
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 | DateTime | Date;
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", "~", "M", "~", "yyyy"]);
166
- const FMT_dMMMyyyy = defFormat(["d", "~~", "MMM", " ", "yyyy"]);
167
- const FMT_HHmm = defFormat(["HH", ":", "mm"]);
168
- const FMT_hm = defFormat(["h", ":", "mm", " ", "A"]);
169
- const FMT_HHmmss = defFormat(["HH", ":", "mm", ":", "ss"]);
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", ":", "mm", ":", "ss", " ", "A"]);
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
@@ -14,7 +14,6 @@ const EN_SHORT = {
14
14
  "Dec"
15
15
  ],
16
16
  days: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
17
- sepHM: ".",
18
17
  date: ["dd", "/DM", "MM", "/MY", "yyyy"],
19
18
  time: ["h", "/HM", "mm", " ", "a"],
20
19
  units: {
package/i18n.js CHANGED
@@ -6,6 +6,7 @@ const __prepLocale = (spec) => {
6
6
  sepDM: "/",
7
7
  sepMY: "/",
8
8
  sepHM: ":",
9
+ sepMS: ":",
9
10
  date: ["E", "/ED", "d", "/DM", "MMM", "/MY", "yyyy"],
10
11
  time: ["H", "/HM", "mm"],
11
12
  ...spec
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/date",
3
- "version": "2.7.82",
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://github.com/thi-ng/umbrella.git",
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.17",
44
- "@thi.ng/checks": "^3.8.7",
45
- "@thi.ng/strings": "^3.11.0"
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": "d46ec975b426bb2ceb137cab734395c97436d59b\n"
138
+ "gitHead": "4924437d79b0a602593f972b6537d8eba3e0b2ee\n"
139
139
  }