fix(date-picker): remove timestamp when setting "today" date #954
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.
PR Checklist
Please check if your PR fulfills the following requirements:
Describe the new behavior?
When clicking the today button (or using keyboard shortcuts) the date value for the current day will no longer include a timestamp by default.
The calendar itself removes the timestamp already, but since the date-picker and date-range-picker both handle the "today" logic separately by creating a new
Date
objects, each needed to remove the timestamp as well.It's important to remember that due to the changes made in #688, if there is a
Date
already set that contains a timestamp, that timestamp will be preserved because we then attempt to merge the new "today" date with the existing date value... This is done to avoid inadvertently removing the timestamp on aDate
object if developers have the timestamp set in their model value, and there is an expectation already set in these components that it will not remove that timestamp. For developers not using timestamps, this should now be fixed and timestamps will be removed.Additional information
Fixes #943