Date format preference#19
Draft
AntoineRelief wants to merge 9 commits into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Old PR
Use the preferred date format of the user (selected in the preferences) in the grid widgets.
How it works? We first set the local language of the whole grid widget to the language of the date format (selected by the user in preferences). Then, in the
grid-service, we use the{ date: 'short' }format which format the date according to the locale language of the widget. This way, the date is formatted according to the user preference and instantly updated when the preference is updated.The cons of this method is that the other elements of the widget (such as the name of months in the date picker for example) are translated in the language selected for dates, and not in the main language selected in the preferences. Note that is does not affect the "messages" of the widget (that is to say the other texts of kendo widgets which are already translated in our application).
This pull request also correct the date picker of material-angular in filters to make them following the user preference, the same way as for the dates of grid widgets.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.
Create a form with a date field and some records, then create a dashboard with a grid widget and display the date field. The format of the date in the field should follow the date format selected in the preferences.
Checklist: