Skip to content

Incorrect date returned using date only picker and going from non-DST to DST date #1112

Open
@adamreisnz

Description

@adamreisnz

Describe the bug
When the datepicker is initialized with a date that falls within DST, and the user then selects a date that falls outside of DST, the picker will incorrectly select one day early.

To Reproduce
Failing example (v11.0.2) – https://stackblitz.com/edit/vuepic-vue-datepicker-rxa4wute

Steps to reproduce the behavior:

  1. Change your local computer's timezone to Pacific/Auckland
  2. Observe the date picker is initialized on 27-03-2025 (which is in DST in the specified timezone)
  3. Click on the date picker
  4. Select 27 DECEMBER 2025
  5. Observe that the date picks selects 26 DECEMBER 2025 instead
  6. Observe that the local reported date is 12/26/2025, 11:00:00 PM instead of 12/27/2025, 00:00:00

Expected behavior
The datepicker should select 27 DECEMBER 2025 when the user clicks on 27 DECEMBER 2025

I would personally expect that when not using the time picker, the dates returned would always return as a midnight timestamp on the selected date in the specified timezone.

If not using the timepicker, the user doesn't care about the time portion and is just interested in a date. So we should get the expected date in all circumstances, and not have it be dependent on what previous date was selected.

Edit: It seems this problem mainly occurs when your system timezone is not in the same timezone as the one you're testing with. However, Datepicker should respect the timezone provided as input prop.

Screenshots
Image

Desktop & mobile (please complete the following information):

  • Chrome
  • 11.0.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions