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

Fix date format for end date to match start date #1025

Merged
merged 1 commit into from
May 19, 2023
Merged

Fix date format for end date to match start date #1025

merged 1 commit into from
May 19, 2023

Conversation

ujwalkumar1995
Copy link
Contributor

Hey @kristoferlund
This PR is for the issue #1021
Let me know in case any changes are required.

Copy link
Member

@kristoferlund kristoferlund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick fix. The period end date is not shown only there though. Look a few lines below and you will see <PeriodDateForm /> where date also is shown. Rule is like this:

  • If user is regular user, display date in div
  • If user is admin, display a date input allowing the admin to change date

@ujwalkumar1995
Copy link
Contributor Author

Hey @kristoferlund
Thank you for the feedback. I assume you want me to try and set a format on the input of the date.. I did some research and as per below docs it says

Note: The displayed date format will differ from the actual value — the displayed date is formatted based on the locale of the user's browser, but the parsed value is always formatted yyyy-mm-dd.

Also mentioning the link for your reference.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date

Could you please let me know if I am missing something here?

@kristoferlund
Copy link
Member

@ujwalkumar1995, the displayed date should be formatted yyyy-mm-dd, the parsed value we don't need to touch, but maybe that is not achievable with the default date input?

@ujwalkumar1995
Copy link
Contributor Author

Hi @kristoferlund
Yes that is at least what I could understand from my research. The display date in input takes the format from browser depending on user's locale.

@kristoferlund
Copy link
Member

@ujwalkumar1995 Thank you for looking into this! I will be merging your PR. We would like to solve this issue eventually, using another date component or some small trick to achieve desired result with the default input. If you would like to take this on, feel free. In any case, thanks for your contribution so far!

@kristoferlund kristoferlund self-requested a review May 19, 2023 07:11
Copy link
Member

@kristoferlund kristoferlund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants