@alexisapp/leave-core 0.0.1-beta.2 → 0.0.1-beta.3
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/utils/index.mjs
CHANGED
|
@@ -17,7 +17,8 @@ var shortDateWithYearFormatter = new Intl.DateTimeFormat("en-GB", {
|
|
|
17
17
|
});
|
|
18
18
|
var EN_DASH = "\u2013";
|
|
19
19
|
function parseLocalDate(dateStr) {
|
|
20
|
-
const
|
|
20
|
+
const dateOnly = dateStr.slice(0, 10);
|
|
21
|
+
const [year, month, day] = dateOnly.split("-").map(Number);
|
|
21
22
|
return new Date(year, month - 1, day);
|
|
22
23
|
}
|
|
23
24
|
function getCurrentYear() {
|
package/package.json
CHANGED
|
@@ -12,7 +12,8 @@ const shortDateWithYearFormatter = new Intl.DateTimeFormat('en-GB', {
|
|
|
12
12
|
const EN_DASH = '\u2013';
|
|
13
13
|
|
|
14
14
|
function parseLocalDate(dateStr: string): Date {
|
|
15
|
-
const
|
|
15
|
+
const dateOnly = dateStr.slice(0, 10);
|
|
16
|
+
const [year, month, day] = dateOnly.split('-').map(Number) as [number, number, number];
|
|
16
17
|
return new Date(year, month - 1, day);
|
|
17
18
|
}
|
|
18
19
|
|