Fixed PublishDateTimePicker issue with Now() returning null #68331
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.
Resolves #60281
What?
This PR fixes an issue in the publish date-time picker where clicking the "Now" button was returning null instead of the current datetime, causing incorrect GMT date settings when user switches to next day and back.
Why?
Currently, when users click the "Now" button in the publish date-time picker, the component returns null, which creates an inconsistency with the DatePickerComponent's expected behavior. This results in dates being incorrectly set in GMT format, impacting the accuracy of publish timestamps.
The change is necessary to ensure consistent datetime handling across the application and prevent intermittent parsing issues between component updates.
How?
The implementation modifies the "Now" button click handler to return the current datetime as an ISO string (without timezone information) instead of null. This aligns with the expected input format for both TimePicker and DateTimePicker components.
The change replaces:
with:
Testing Instructions
5.1 Click on future Date then observe that publish has changed to schedule
5.2 Click the "Now" button in the picker header and observe the publish button
5.3 Click on future date and then switch to current date manually,
Screencast
Test.Publish.mp4