-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(IT Wallet): [SIW-664] Format date in credentials claims list (#…
…5218) ## Short description This PR adds the date formatting in the credentials claims list. The proposed function is applied to every claim and checks wether or not the string representing the claim is a string in the format `YYYY-DD-MM`. Then it formats it with the current locale in short format. Otherwise it returns the input string untouched. Trying to parse a date with `new Date()` is not enough as it converts to date any number and that means some claims would be incorrectly formatted as date. The regex used to match the string is basically a mock because it currently suits our needs with the only issued credential at this point. It could be different in the future. ## List of changes proposed in this pull request - Adds a function which formats dates when parsing the claims. ## How to test Try to obtain a credential and check the preview screen. Each date should be properly formatted according to the current locale in short format. Co-authored-by: Mario Perrotta <mario.perrotta@pagopa.it>
- Loading branch information
1 parent
0379c2a
commit c060abe
Showing
3 changed files
with
32 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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