Skip to content

Date format preference#19

Draft
AntoineRelief wants to merge 9 commits into
betafrom
OORT-220
Draft

Date format preference#19
AntoineRelief wants to merge 9 commits into
betafrom
OORT-220

Conversation

@AntoineRelief

Copy link
Copy Markdown
Collaborator

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.

  • Bug fix (non-breaking change which fixes an issue)
  • Improvement (refactor or addition to existing functionality)

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:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have put JSDoc comment in all required places
  • I have made corresponding changes to the documentation ( if required )
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@AntoineRelief AntoineRelief added the enhancement New feature or request label Nov 27, 2023
@AntoineRelief AntoineRelief changed the title Oort 220 Date format preference Nov 27, 2023
@AntoineRelief AntoineRelief marked this pull request as draft November 27, 2023 15:56
@AntoineRelief AntoineRelief added the icebox On hold label Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request icebox On hold

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants