Skip to content

Commit

Permalink
account for timezone offsets when instantiating new dateSelected
Browse files Browse the repository at this point in the history
  • Loading branch information
bfauble committed Oct 31, 2023
1 parent 24a2010 commit 0e0c8c7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions assets/src/chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ const setupDatePickers = () => {
) as HTMLInputElement
if (serviceDateInput) {
datepicker(serviceDateInput, {
dateSelected: new Date(serviceDateInput.value),
dateSelected: new Date(serviceDateInput.value + "T12:00:00.000Z"),
formatter: dateFormatter,
showAllDates: true,
})
Expand All @@ -271,12 +271,12 @@ const setupDatePickers = () => {
) as HTMLInputElement
if (dateStartInput && dateEndInput) {
datepicker(dateStartInput, {
dateSelected: new Date(dateStartInput.value),
dateSelected: new Date(dateStartInput.value + "T12:00:00.000Z"),
formatter: dateFormatter,
showAllDates: true,
})
datepicker(dateEndInput, {
dateSelected: new Date(dateEndInput.value),
dateSelected: new Date(dateEndInput.value + "T12:00:00.000Z"),
formatter: dateFormatter,
showAllDates: true,
})
Expand Down

0 comments on commit 0e0c8c7

Please sign in to comment.