@8ms/helpers 2.0.19 → 2.0.21
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/.yarn/install-state.gz +0 -0
- package/date/calculation.d.ts +1 -1
- package/date/calculation.js +12 -1
- package/package.json +1 -1
package/.yarn/install-state.gz
CHANGED
|
Binary file
|
package/date/calculation.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { InputDate, Timeframe } from "./";
|
|
|
3
3
|
/**
|
|
4
4
|
* Convert an client's input (any time-zone) ready to be used by the server (UTC).
|
|
5
5
|
*/
|
|
6
|
-
export declare const getUtcDate: (input
|
|
6
|
+
export declare const getUtcDate: (input?: InputDate, inputZone?: Zone) => DateTime<true> | DateTime<false>;
|
|
7
7
|
export declare const getUnix: (input?: InputDate) => number;
|
|
8
8
|
/**
|
|
9
9
|
* Assume the input is always UTC.
|
package/date/calculation.js
CHANGED
|
@@ -21,7 +21,18 @@ const getUtcDate = (input, inputZone) => {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
const utcInstance = luxon_1.DateTime.fromObject({
|
|
25
|
+
year: instance.year,
|
|
26
|
+
month: instance.month,
|
|
27
|
+
day: instance.day,
|
|
28
|
+
hour: instance.hour,
|
|
29
|
+
minute: instance.minute,
|
|
30
|
+
second: instance.second,
|
|
31
|
+
millisecond: instance.millisecond,
|
|
32
|
+
}, {
|
|
33
|
+
zone: "utc"
|
|
34
|
+
});
|
|
35
|
+
return utcInstance;
|
|
25
36
|
};
|
|
26
37
|
exports.getUtcDate = getUtcDate;
|
|
27
38
|
const getUnix = (input) => {
|