chronal 0.0.24 → 0.0.25
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-date.d.ts","sourceRoot":"","sources":["../../src/lib/format-date.ts"],"names":[],"mappings":"AAKA,KAAK,aAAa,GAAG;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;
|
|
1
|
+
{"version":3,"file":"format-date.d.ts","sourceRoot":"","sources":["../../src/lib/format-date.ts"],"names":[],"mappings":"AAKA,KAAK,aAAa,GAAG;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAwIF;;;;;;;;;;;;;GAaG;AAEH,wBAAgB,UAAU,CACxB,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,aAAkB,GAC1B,MAAM,CAaR"}
|
package/esm/lib/format-date.js
CHANGED
|
@@ -85,7 +85,7 @@ function getPartsWithTZ(date, locale, tz) {
|
|
|
85
85
|
year: 0,
|
|
86
86
|
month: 0,
|
|
87
87
|
day: 0,
|
|
88
|
-
dayOfWeek:
|
|
88
|
+
dayOfWeek: 0,
|
|
89
89
|
hour: 0,
|
|
90
90
|
minute: 0,
|
|
91
91
|
second: 0,
|
|
@@ -113,6 +113,8 @@ function getPartsWithTZ(date, locale, tz) {
|
|
|
113
113
|
break;
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
+
// Derive dayOfWeek from the TZ-adjusted date components, not OS local time
|
|
117
|
+
p.dayOfWeek = new Date(Date.UTC(p.year, p.month - 1, p.day)).getUTCDay();
|
|
116
118
|
return p;
|
|
117
119
|
}
|
|
118
120
|
/**
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-date.d.ts","sourceRoot":"","sources":["../../src/lib/format-date.ts"],"names":[],"mappings":"AAKA,KAAK,aAAa,GAAG;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;
|
|
1
|
+
{"version":3,"file":"format-date.d.ts","sourceRoot":"","sources":["../../src/lib/format-date.ts"],"names":[],"mappings":"AAKA,KAAK,aAAa,GAAG;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAwIF;;;;;;;;;;;;;GAaG;AAEH,wBAAgB,UAAU,CACxB,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,aAAkB,GAC1B,MAAM,CAaR"}
|
|
@@ -88,7 +88,7 @@ function getPartsWithTZ(date, locale, tz) {
|
|
|
88
88
|
year: 0,
|
|
89
89
|
month: 0,
|
|
90
90
|
day: 0,
|
|
91
|
-
dayOfWeek:
|
|
91
|
+
dayOfWeek: 0,
|
|
92
92
|
hour: 0,
|
|
93
93
|
minute: 0,
|
|
94
94
|
second: 0,
|
|
@@ -116,6 +116,8 @@ function getPartsWithTZ(date, locale, tz) {
|
|
|
116
116
|
break;
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
|
+
// Derive dayOfWeek from the TZ-adjusted date components, not OS local time
|
|
120
|
+
p.dayOfWeek = new Date(Date.UTC(p.year, p.month - 1, p.day)).getUTCDay();
|
|
119
121
|
return p;
|
|
120
122
|
}
|
|
121
123
|
/**
|