@hapiboo/date 3.0.0 → 3.0.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/dist/class.d.ts +3 -0
- package/dist/class.js +9 -0
- package/package.json +7 -2
package/dist/class.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ export declare class DateObject {
|
|
|
9
9
|
static startOfMonth(): DateObject;
|
|
10
10
|
static startOfYear(): DateObject;
|
|
11
11
|
get _value(): string;
|
|
12
|
+
get second(): number;
|
|
13
|
+
get minute(): number;
|
|
12
14
|
get hour(): number;
|
|
13
15
|
get day(): number;
|
|
14
16
|
get month(): number;
|
|
@@ -47,4 +49,5 @@ export declare class DateObject {
|
|
|
47
49
|
valueOf(): number;
|
|
48
50
|
getDaysDifference(dateToCompare: DateObject): number;
|
|
49
51
|
getHoursDifference(dateToCompare: DateObject): number;
|
|
52
|
+
getMilisecondsDifference(dateToCompare: DateObject): number;
|
|
50
53
|
}
|
package/dist/class.js
CHANGED
|
@@ -36,6 +36,12 @@ class DateObject {
|
|
|
36
36
|
get _value() {
|
|
37
37
|
return this.toString();
|
|
38
38
|
}
|
|
39
|
+
get second() {
|
|
40
|
+
return this.val.second;
|
|
41
|
+
}
|
|
42
|
+
get minute() {
|
|
43
|
+
return this.val.minute;
|
|
44
|
+
}
|
|
39
45
|
get hour() {
|
|
40
46
|
return this.val.hour;
|
|
41
47
|
}
|
|
@@ -160,5 +166,8 @@ class DateObject {
|
|
|
160
166
|
getHoursDifference(dateToCompare) {
|
|
161
167
|
return luxon_1.Interval.fromDateTimes(this.val, dateToCompare.val).toDuration(['hours', 'minutes']).hours;
|
|
162
168
|
}
|
|
169
|
+
getMilisecondsDifference(dateToCompare) {
|
|
170
|
+
return this.val.diff(dateToCompare.val).as('milliseconds');
|
|
171
|
+
}
|
|
163
172
|
}
|
|
164
173
|
exports.DateObject = DateObject;
|
package/package.json
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hapiboo/date",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"description": "MK13 Studio Hapiboo - date services",
|
|
5
5
|
"author": "MK13 Studio",
|
|
6
6
|
"license": "ISC",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"types": "dist/index.d.ts",
|
|
9
|
+
"publishConfig": {
|
|
10
|
+
"access": "public"
|
|
11
|
+
},
|
|
9
12
|
"files": [
|
|
10
13
|
"dist"
|
|
11
14
|
],
|
|
@@ -21,8 +24,10 @@
|
|
|
21
24
|
"typescript-eslint": "^8.51.0"
|
|
22
25
|
},
|
|
23
26
|
"scripts": {
|
|
27
|
+
"version-to-publish": "pnpm exec tsx ../../scripts/version_update.ts packages/date --publish-version",
|
|
24
28
|
"publish-check": "bash ../../scripts/publish.sh ./",
|
|
29
|
+
"version-to-children": "pnpm exec tsx ../../scripts/version_update.ts packages/date --update-children",
|
|
25
30
|
"ci:publish-prepare": "rm -f pnpm-lock.yaml && rm -rf node_modules dist && pnpm install --ignore-workspace --no-frozen-lockfile && eslint 'src/*.ts' && echo \"Linter OK\" && tsc && echo \"Build OK\"",
|
|
26
|
-
"ci:publish": "pnpm ci:publish-prepare && pnpm publish-check"
|
|
31
|
+
"ci:publish": "pnpm ci:publish-prepare && pnpm version-to-publish && pnpm publish-check && pnpm version-to-children"
|
|
27
32
|
}
|
|
28
33
|
}
|