@arsedizioni/ars-utils 22.0.33 → 22.0.34
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.
|
@@ -171,7 +171,7 @@ class DateFnsAdapter extends DateAdapter {
|
|
|
171
171
|
if (month < 0 || month > 11) {
|
|
172
172
|
throw Error(`Invalid month index "${month}". Month index has to be between 0 and 11.`);
|
|
173
173
|
}
|
|
174
|
-
const result = new TZDate(year, month, date,
|
|
174
|
+
const result = new TZDate(year, month, date, 12, 0, 0, 0, 'Europe/Rome');
|
|
175
175
|
if (result.getMonth() !== month) {
|
|
176
176
|
throw Error(`Invalid date "${date}" for month with index "${month}".`);
|
|
177
177
|
}
|
|
@@ -181,7 +181,9 @@ class DateFnsAdapter extends DateAdapter {
|
|
|
181
181
|
* Returns today's date in the local timezone.
|
|
182
182
|
*/
|
|
183
183
|
today() {
|
|
184
|
-
|
|
184
|
+
const t = new TZDate(new Date(), 'Europe/Rome');
|
|
185
|
+
t.setHours(12, 0, 0, 0);
|
|
186
|
+
return t;
|
|
185
187
|
}
|
|
186
188
|
/**
|
|
187
189
|
* Parses a value into a `Date`.
|