Fix issue where the date displayed by mat-datepicker was one day off from what was specified in the JSON #308
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.
Fix issue where the date displayed by mat-datepicker was one day off from what was specified in the JSON
PR Type
What changes does this PR include (check all that apply)?
[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build process changes
[ ] Documentation changes
[ ] Other... please describe:
Related issue / current behavior
The date displayed by mat-datepicker is one day off from the data in the JSON.
For example:
Notice that this is not an issue for the other design frameworks, which correctly display "07/21/1999".
New behavior
Date displayed in the generated mat-datepicker matches the data in the JSON.
Does this PR introduce a breaking change?
[ ] Yes
[x] No
Any other relevant information
At first, thought it was an issue with timezones and mat-datepicker (e.g. here). However, it appears that the functions in date.functions.ts were all working correctly to avoid timezone issues.
Found that when the second matInput in the material-datepicker-widget component was used (the one with *ngIf="!boundControl"), this issue did not come up.
Concluded that the reason this issue still exists is because although the dateValue property is computed correctly, it's not being used in the first matInput (the one with *ngIf="boundControl").