vuetifyjs / vuetify

🐉 Vue Component Framework
https://vuetifyjs.com
MIT License
39.86k stars 6.97k forks source link

[Bug Report][2.5.8] DatePicker chooses the wrong year when locale settings are enabled (Jalali)! #14016

Closed hasanparasteh closed 2 years ago

hasanparasteh commented 3 years ago

Environment

Vuetify Version: 2.5.8 Vue Version: 2.6.11 Browsers: Firefox 78.0 OS: Mac OS 10.15

Steps to reproduce

When I choose my birthdate in my locale date picker the value of the date is one year different than expected...

Expected Behavior

For example, when I choose 1377-09-28 in Persian date the value that is on the text field is 1999-12-19 which is wrong!

Actual Behavior

The date it should be is 1998-12-19!

Reproduction Link

First clicks on the text field to open up the date picker then clicks on month-year( for example مرداد ۱۴۰۰ from the top of the date picker) after that the months shows up and I click on the year(for example ۱۴۰۰) and then scroll down to the year I want(for example ۱۳۷۷) then I click on a month name(for example آذر) and after that, I choose a day(for example ۲۸). This is where the bug shows itself and the selected year is wrong.

https://codesandbox.io/s/vuetifydatepickerissue-btqfv

Screenshot

Screen Shot 2021-08-01 at 3 54 33 PM
paddotk commented 2 years ago

Why should the date be 1998-12-19 when you input 1377-09-28? It seems, either way, that the datepicker can only go back 100 years, so 1377 is probably not considered valid by the component.

hasanparasteh commented 2 years ago

I changed the locale and I expect that it would change the date picker into Jalali Calendar instead of Gregorian calendar