@arsedizioni/ars-utils 22.0.43 → 22.0.46

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.
@@ -198,7 +198,9 @@ class DateFnsAdapter extends DateAdapter {
198
198
  if (typeof value === 'string' && value.length > 0) {
199
199
  const iso8601Date = parseISO(value);
200
200
  if (this.isValid(iso8601Date)) {
201
- return new TZDate(iso8601Date, 'Europe/Rome');
201
+ const t = new TZDate(iso8601Date, 'Europe/Rome');
202
+ t.setHours(12, 0, 0, 0);
203
+ return t;
202
204
  }
203
205
  const formats = Array.isArray(parseFormat) ? parseFormat : [parseFormat];
204
206
  if (!formats.length) {
@@ -209,13 +211,17 @@ class DateFnsAdapter extends DateAdapter {
209
211
  locale: this.locale
210
212
  });
211
213
  if (this.isValid(fromFormat)) {
212
- return new TZDate(fromFormat, 'Europe/Rome');
214
+ const t = new TZDate(fromFormat, 'Europe/Rome');
215
+ t.setHours(12, 0, 0, 0);
216
+ return t;
213
217
  }
214
218
  }
215
219
  return this.invalid();
216
220
  }
217
221
  else if (typeof value === 'number') {
218
- return new Date(value);
222
+ const t = new TZDate(new Date(value), 'Europe/Rome');
223
+ t.setHours(12, 0, 0, 0);
224
+ return t;
219
225
  }
220
226
  else if (value instanceof Date) {
221
227
  return this.clone(value);