Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DatePicker bug, when using 'fa' value for MAT_DATE_LOCALE #13332

Closed
hapoo44 opened this issue Sep 27, 2018 · 4 comments
Closed

DatePicker bug, when using 'fa' value for MAT_DATE_LOCALE #13332

hapoo44 opened this issue Sep 27, 2018 · 4 comments
Assignees
Labels
needs: discussion Further discussion with the team is needed before proceeding

Comments

@hapoo44
Copy link

hapoo44 commented Sep 27, 2018

Bug, feature request, or proposal:

this is a bug, when you inject MAT_DATE_LOCALE by 'fa' value, the datepicker calendar shows incorrect days for each month. incorrect means exactly each day number is added by 3. so if today is 5th day of month, calendar shows 8 and if tomorrow is 6th day of month, calendar shows 9.
and if you select today which calendar show as 8, the correct number placed in date input. that means 5 is placed in date input .

What is the expected behavior?

the expected behavior is calendar must show every day number minus 3.

What is the current behavior?

the current behavior is calendar add 3 to each day number. that mean today is 5th day of month but calendar shows 8. and when you select 8, in date input correct day number (5) is placed.

What are the steps to reproduce?

just put
{
provide: MAT_DATE_LOCALE,
useValue: 'fa-IR'
}
in app module providers and if you know jalali or persian calendar, you can see the bug
and if you don't know this calendar, just select one day in calendar and you see the selected date day number in input is 3 less than day selected in calendar. the input is correct and the calendar is incorrect.

What is the use-case or motivation for changing an existing behavior?

it's a jalali calendar. the most accurate solar calendar in world and used by four and more country in the world.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

i test it with angular 6.0.2 and material 6.0.2 and material 6.4.7. and both of them had that bug

Is there anything else we should know?

if anyone help what code show's days in calendar , i can solve it.

@hapoo44
Copy link
Author

hapoo44 commented Sep 27, 2018

i think the bug is because the calendar shows the number of days for gregorian month,
that means some jalali month is 31 day's, some 30 day's and one 29 day's. and calendar shows day's for gregorian month that means if the jalali month is 31 day's and gregorian month is 30 day's that bug occur.
but when you select the day, the selected date is correct

@jelbourn
Copy link
Member

jelbourn commented Oct 3, 2018

@mmalerba the datepicker only supports the gregorian calendar, right?

@mmalerba
Copy link
Contributor

mmalerba commented Oct 3, 2018

Yes, out of the box we only support Gregorian, though I have seen people post that they've been able to create adapters for the Jalali calendar. See #5972 and #2519

@mmalerba mmalerba closed this as completed Oct 3, 2018
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
@mmalerba mmalerba added the needs: discussion Further discussion with the team is needed before proceeding label Mar 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: discussion Further discussion with the team is needed before proceeding
Projects
None yet
Development

No branches or pull requests

3 participants