Skip to content

DatePickerInput: don't add ms to default date#1851

Merged
labkey-alan merged 5 commits intodevelopfrom
fb_issue_53577
Sep 12, 2025
Merged

DatePickerInput: don't add ms to default date#1851
labkey-alan merged 5 commits intodevelopfrom
fb_issue_53577

Conversation

@labkey-alan
Copy link
Copy Markdown
Contributor

@labkey-alan labkey-alan commented Sep 10, 2025

Rationale

This PR addresses Issue 53577

Related Pull Requests

Changes

  • DatePickerInput: pass openToDate to DatePicker
    • By passing openToDate DatePicker longer erroneously adds milliseconds when setting a value for the first time, or when adding a value when hitting enter after triggering the input

@labkey-alan labkey-alan self-assigned this Sep 10, 2025
@labkey-alan labkey-alan changed the title Fb DatePickerInput: don't add ms to default date Sep 10, 2025
*
* See Issue 53577
*/
getOpenToDate = (): Date => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this change can we now get rid of the workaround around line 164?

if (!event && !raw && date?.getMilliseconds() > 0) {
date.setMilliseconds(0); // react-datepicker milliseconds are not 0 when selecting time
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, good catch. I have verified my fix still works without that change.

@labkey-alan labkey-alan merged commit 7db11c0 into develop Sep 12, 2025
3 checks passed
@labkey-alan labkey-alan deleted the fb_issue_53577 branch September 12, 2025 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants