@purple-brock/time 0.0.0-stage → 1.0.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/LICENSE +21 -0
- package/README.md +934 -2
- package/dist/Badger.d.ts +154 -0
- package/dist/BadgerSett.d.ts +45 -0
- package/dist/BadgerSettings.d.ts +14 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +1568 -0
- package/dist/index.mjs +1564 -0
- package/dist/localeInfo.d.ts +10 -0
- package/package.json +60 -4
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** A locale as an `Intl.Locale` or a plain BCP 47 tag (e.g. `"sv-SE"`). */
|
|
2
|
+
export type LocaleInput = Intl.Locale | string;
|
|
3
|
+
/** The BCP 47 tag for `locale`, falling back to `BadgerSettings.defaultLocale`, then `"en-GB"`. */
|
|
4
|
+
export declare function localeTag(locale?: LocaleInput): string;
|
|
5
|
+
/** ISO first day of the week (1 = Monday … 7 = Sunday). Defaults to Monday. */
|
|
6
|
+
export declare function firstDayOfWeek(locale?: LocaleInput): number;
|
|
7
|
+
/** ISO weekend days (1 = Monday … 7 = Sunday). Defaults to Saturday + Sunday. */
|
|
8
|
+
export declare function weekendDays(locale?: LocaleInput): number[];
|
|
9
|
+
/** Whether the locale's default clock is 12-hour, read from Intl.DateTimeFormat (no Intl.Locale). */
|
|
10
|
+
export declare function uses12HourClock(locale: string): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,62 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@purple-brock/time",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Lightweight date engine and formatter — no moment, no date-fns.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.mjs",
|
|
11
|
+
"require": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"LICENSE"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "npm run build:types && npm run build:bundle && npm run build:strip-types",
|
|
21
|
+
"build:strip-types": "node scripts/strip-dts-comments.mjs",
|
|
22
|
+
"build:types": "tsc --emitDeclarationOnly --declaration --declarationDir dist",
|
|
23
|
+
"build:bundle": "rollup -c",
|
|
24
|
+
"prepublishOnly": "npm run build",
|
|
25
|
+
"test": "TZ=UTC vitest run --coverage",
|
|
26
|
+
"test:watch": "TZ=UTC vitest",
|
|
27
|
+
"test:cet": "TZ=Europe/Berlin vitest run --config vitest.cet.config.mts",
|
|
28
|
+
"test:ny": "TZ=America/New_York vitest run --config vitest.ny.config.mts",
|
|
29
|
+
"test:la": "TZ=America/Los_Angeles vitest run --config vitest.la.config.mts"
|
|
30
|
+
},
|
|
31
|
+
"keywords": [
|
|
32
|
+
"date",
|
|
33
|
+
"datetime",
|
|
34
|
+
"formatter",
|
|
35
|
+
"intl",
|
|
36
|
+
"lightweight"
|
|
37
|
+
],
|
|
38
|
+
"engines": {
|
|
39
|
+
"node": ">=20"
|
|
40
|
+
},
|
|
41
|
+
"license": "MIT",
|
|
42
|
+
"repository": {
|
|
43
|
+
"type": "git",
|
|
44
|
+
"url": "git+https://github.com/lrprice79/badger-time.git"
|
|
45
|
+
},
|
|
46
|
+
"homepage": "https://github.com/lrprice79/badger-time#readme",
|
|
47
|
+
"bugs": {
|
|
48
|
+
"url": "https://github.com/lrprice79/badger-time/issues"
|
|
49
|
+
},
|
|
50
|
+
"publishConfig": {
|
|
51
|
+
"access": "public"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@rollup/plugin-typescript": "^12.1.2",
|
|
55
|
+
"@types/node": "^25.9.3",
|
|
56
|
+
"@vitest/coverage-v8": "^5.0.5",
|
|
57
|
+
"rollup": "^4.30.1",
|
|
58
|
+
"tslib": "^2.8.1",
|
|
59
|
+
"typescript": "^5.7.3",
|
|
60
|
+
"vitest": "^5.0.5"
|
|
61
|
+
}
|
|
62
|
+
}
|