vuetify: [Bug Report] v-date-picker new month is started at the end of previous month in FA-local
Steps to reproduce
Versions
Vuetify 0.15.7 and vue2.4
What is expected ?
In date picker month should be started with its first day. which is not working for ‘FA’ locals.
What is actually happening ?
for current date 26 SEP 2017, correct value in FA local is مهر ۴, ۱۳۹۶
۴ means 4 in English and مهر is the month 7th in Persian and ۱۳۹۶ means 1396.
but in the date picker white space header it is showing ۱۳۹۶ شهریور .
شهریور is the month 6 in FA local.
on the other hand for blue space it is showing مهر ۴ means 4th day of month 7 which is correct one.
Another problem is date picker table. in codepen month 7 is started at the end of month 6. ۱ or 1 in English is the first day of month 7 in FA local which should be in the first row of table but now it is on the last row after ۳۱ or 31 of month 6 in FA local.
Reproduction Link
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 23
- Comments: 28 (10 by maintainers)
Commits related to this issue
- feat(date-picker): add support for persian calendar (jalali calendar) this change affects fa-IR locale, and corrects the datepicker behavior to adpat with persian calendar fix #1892 — committed to a-shafaat/vuetify by a-shafaat 4 years ago
- feat(date-picker): add support for persian calendar (jalali calendar) this change affects fa-IR locale, and corrects the datepicker behavior to adpat with persian calendar fix #1892 — committed to a-shafaat/vuetify by a-shafaat 4 years ago
it’s so important to be fix
After talking with the team, we haven’t been able to nail this one down. I’m moving this to the Vuetify 3 project so that we can re-evaluate it once we get to Phase 3 of the development process (The one where we put
v-date-pickertogether), to see if it can happen naturally or at least have some sort of path forward.Once we get to that point I will update this thread and see what options we have available. Thank you for your patience.
If you have any questions, please reach out to us in our Discord community.
Wrong date time showing, It’s actually a bug not an enhancement, i hope it’s fix soon.
OMG it’s been 2 years and this is not fixed yet! This problem also exists in the ‘ar-sa’ locale.
Same issue here… Can’t be used in a production level web app!
Any updates? @jacekkarczmarczyk
Any plan for fixing this in vuetify roadmap ? will it be fix at v3.0 (Titan) ?
@jacekkarczmarczyk
https://moment.github.io/luxon/docs/ might be good tools for i18n date time
As i mentioned we need aggregate cldr data for get correct date time information base on locale: https://github.com/vuetifyjs/vuetify/issues/6881
Best date time picker approach is many countries has multiple calendar system and fortunately Intl.Datetime format is good.
I think best approach for date time picker will be good if:
Remove hard coded parts use variable base on locales, use CLDR.
Component data must be Date object not an string, sees both Vuetify and Quasar Dont use this method, String manipulation is not great.
🥇 Notice If you work as backend developer consider clients always send UnixTimeStamp and you always send UnixtTimeStamp though. It’s hard this process to carry on backend, browser knows about intl and client timezone lets client process this one.
Notice For date only we can use
UTC 12:00:00not00:00:00or23:59:59for timezone diff.Sample for
FA-IR:I could help with this algorithm for process but i’m not Vuejs or Vuetify expert.
Conclusion:
Quasar already implemented: https://codepen.io/rstoenescu/pen/wOGpZg
This bug is related to an earlier version of Vuetify. If this is still present in v3 of the framework, please create a new issue. Thank you!
@jacekkarczmarczyk @johnleider, simple implentation using https://github.com/moment/luxon:
Datenot the stupid stringI said before input string is not valid approach. Most of date time pickers use this way, and it’s wrong.
Open with latest Desktop chrome or latest Nightly firefox (Problem is for DisplayName)
Older version using moment : https://github.com/artmarydotir/aasaam-vuetify-datetime https://github.com/aasaam/date-time
When we switch to fa local, If there is no day specified in date string just (2020-01) then we will convert firt day of month (2020-1-1) to persian which is (1399-10-11). then the selected month in FA will be 10. Did you got it?
@MustafaHussaini do you have some idea how it should behave when you have set month to
2020-01in en locale and then you switch to fa?edit: in month picker
I agree that fixing the display is enough. It’s been years since this problem issued. I really appreciate if this problem gets fixed soon.