@thi.ng/date 2.7.83 → 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
@@ -69,7 +69,7 @@ For Node.js REPL:
69
69
  const date = await import("@thi.ng/date");
70
70
  ```
71
71
 
72
- Package sizes (brotli'd, pre-treeshake): ESM: 5.42 KB
72
+ Package sizes (brotli'd, pre-treeshake): ESM: 5.43 KB
73
73
 
74
74
  ## Dependencies
75
75
 
@@ -381,6 +381,7 @@ string literal, prefix the term with `\\`.
381
381
  | `/DM` | Locale-specific day-month separator |
382
382
  | `/MY` | Locale-specific month-year separator |
383
383
  | `/HM` | Locale-specific hour-minute separator |
384
+ | `/MS` | Locale-specific minute-second separator |
384
385
 
385
386
  <small>(Format IDs somewhat based on Java's
386
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.83",
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",
@@ -135,5 +135,5 @@
135
135
  "thi.ng": {
136
136
  "year": 2020
137
137
  },
138
- "gitHead": "8ddf86ea0a1e658ddbf19cc645b29d0c176e29c4\n"
138
+ "gitHead": "4924437d79b0a602593f972b6537d8eba3e0b2ee\n"
139
139
  }