diff --git a/package.json b/package.json index 40f2a67..528ac88 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tp/tp-date-picker", - "version": "3.0.1", + "version": "3.0.2", "description": "", "main": "tp-date-picker.js", "scripts": { diff --git a/tp-date-picker.js b/tp-date-picker.js index 695959b..c4b115a 100644 --- a/tp-date-picker.js +++ b/tp-date-picker.js @@ -290,15 +290,9 @@ class TpDatePicker extends FormElement(LitElement) { for (const el of e.composedPath()) { if (el.date !== undefined) { this.value = el.date; - // Interpret the selected date as being in the user's timezone, output as UTC ISO string const selectedDate = el.date; - let outputValue; - const zone = this.timeZone || 'local'; - const localDate = DateTime.fromObject( - { year: selectedDate.year, month: selectedDate.month, day: selectedDate.day }, - { zone } - ); - outputValue = localDate.toUTC().toISO(); + // Date-only fields always store UTC midnight — the calendar date is timezone-agnostic. + const outputValue = DateTime.utc(selectedDate.year, selectedDate.month, selectedDate.day).toISO(); this.dispatchEvent(new CustomEvent('value-changed', { detail: outputValue, bubbles: true, composed: true })); return; }