@kuroson/sydneydayjs 0.1.0 → 0.1.2
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 +13 -0
- package/README.md +7 -7
- package/package.json +39 -44
- package/.prettierignore +0 -5
package/CHANGELOG.md
ADDED
package/README.md
CHANGED
|
@@ -15,19 +15,19 @@ yarn add @kuroson/sydneydayjs
|
|
|
15
15
|
## Usage
|
|
16
16
|
|
|
17
17
|
```typescript
|
|
18
|
-
import { sydneyDayjs } from
|
|
18
|
+
import { sydneyDayjs } from "@kuroson/sydneydayjs";
|
|
19
19
|
|
|
20
20
|
// Get current time in Sydney timezone
|
|
21
21
|
const now = sydneyDayjs.now();
|
|
22
|
-
console.log(now.format(
|
|
22
|
+
console.log(now.format("YYYY-MM-DD HH:mm:ss")); // e.g., "2024-01-15 14:30:00"
|
|
23
23
|
|
|
24
24
|
// Create a date in Sydney timezone
|
|
25
|
-
const date = sydneyDayjs.create(
|
|
26
|
-
console.log(date.format(
|
|
25
|
+
const date = sydneyDayjs.create("2024-06-15");
|
|
26
|
+
console.log(date.format("YYYY-MM-DD HH:mm:ss Z")); // "2024-06-15 00:00:00 +10:00"
|
|
27
27
|
|
|
28
28
|
// All standard dayjs methods are available
|
|
29
|
-
console.log(now.add(1,
|
|
30
|
-
console.log(now.startOf(
|
|
29
|
+
console.log(now.add(1, "day").format("dddd")); // e.g., "Tuesday"
|
|
30
|
+
console.log(now.startOf("month").format("YYYY-MM-DD")); // e.g., "2024-01-01"
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
## API
|
|
@@ -46,7 +46,7 @@ Creates a dayjs instance from the given date input, interpreted in Sydney timezo
|
|
|
46
46
|
|
|
47
47
|
```typescript
|
|
48
48
|
// From string
|
|
49
|
-
const date1 = sydneyDayjs.create(
|
|
49
|
+
const date1 = sydneyDayjs.create("2024-06-15");
|
|
50
50
|
|
|
51
51
|
// From Date object
|
|
52
52
|
const date2 = sydneyDayjs.create(new Date());
|
package/package.json
CHANGED
|
@@ -1,46 +1,49 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kuroson/sydneydayjs",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "A pre-configured dayjs wrapper with Sydney (Australia/Sydney) timezone as the default",
|
|
5
5
|
"author": "Alvin Cherk <a.cherk@unsw.edu.au>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
8
|
-
"main": "./
|
|
9
|
-
"module": "./
|
|
10
|
-
"types": "./
|
|
8
|
+
"main": "./dist/index.cjs",
|
|
9
|
+
"module": "./dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
11
|
"exports": {
|
|
12
|
-
".":
|
|
12
|
+
".": {
|
|
13
|
+
"import": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"default": "./dist/index.js"
|
|
16
|
+
},
|
|
17
|
+
"require": {
|
|
18
|
+
"types": "./dist/index.d.cts",
|
|
19
|
+
"default": "./dist/index.cjs"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
13
22
|
"./package.json": "./package.json"
|
|
14
23
|
},
|
|
15
24
|
"engines": {
|
|
16
25
|
"node": ">=22"
|
|
17
26
|
},
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"lint": "eslint './**/*.{ts,js}'",
|
|
22
|
-
"lint:fix": "eslint './**/*.{ts,js}' --fix",
|
|
23
|
-
"prepublishOnly": "pnpm run build",
|
|
24
|
-
"typecheck": "tsc --noEmit"
|
|
27
|
+
"depcheck": {
|
|
28
|
+
"ignores": [],
|
|
29
|
+
"skip-missing": true
|
|
25
30
|
},
|
|
26
31
|
"dependencies": {
|
|
27
32
|
"dayjs": "^1.11.10"
|
|
28
33
|
},
|
|
29
34
|
"devDependencies": {
|
|
30
|
-
"@eslint/js": "
|
|
31
|
-
"@
|
|
32
|
-
"@
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"eslint": "
|
|
36
|
-
"eslint-
|
|
37
|
-
"eslint-plugin-
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"typescript": "catalog:",
|
|
43
|
-
"typescript-eslint": "catalog:"
|
|
35
|
+
"@eslint/js": "9.39.2",
|
|
36
|
+
"@typescript-eslint/eslint-plugin": "8.50.0",
|
|
37
|
+
"@typescript-eslint/parser": "8.50.0",
|
|
38
|
+
"depcheck": "1.4.7",
|
|
39
|
+
"eslint": "9.39.2",
|
|
40
|
+
"eslint-config-prettier": "10.1.8",
|
|
41
|
+
"eslint-plugin-prettier": "5.5.4",
|
|
42
|
+
"eslint-plugin-unused-imports": "4.3.0",
|
|
43
|
+
"prettier": "3.7.4",
|
|
44
|
+
"tsup": "8.5.1",
|
|
45
|
+
"typescript": "5.9.3",
|
|
46
|
+
"typescript-eslint": "8.50.0"
|
|
44
47
|
},
|
|
45
48
|
"peerDependencies": {
|
|
46
49
|
"typescript": ">=4.7.0"
|
|
@@ -51,22 +54,14 @@
|
|
|
51
54
|
}
|
|
52
55
|
},
|
|
53
56
|
"publishConfig": {
|
|
54
|
-
"access": "public"
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
},
|
|
64
|
-
"require": {
|
|
65
|
-
"types": "./dist/index.d.cts",
|
|
66
|
-
"default": "./dist/index.cjs"
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
"./package.json": "./package.json"
|
|
70
|
-
}
|
|
57
|
+
"access": "public"
|
|
58
|
+
},
|
|
59
|
+
"scripts": {
|
|
60
|
+
"build": "tsup",
|
|
61
|
+
"build:all": "tsup",
|
|
62
|
+
"depcheck": "depcheck",
|
|
63
|
+
"lint": "eslint './**/*.{ts,js}'",
|
|
64
|
+
"lint:fix": "eslint './**/*.{ts,js}' --fix",
|
|
65
|
+
"typecheck": "tsc --noEmit"
|
|
71
66
|
}
|
|
72
|
-
}
|
|
67
|
+
}
|