-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[@mantine/dates] fix: date picker input memory leak when string is empty #7780
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,11 +4,11 @@ import { DateStringValue } from '../../types'; | |
export function toDateString( | ||
value: string | number | Date | Dayjs | undefined | null | ||
): DateStringValue | undefined | null { | ||
return value == null ? value : dayjs(value).format('YYYY-MM-DD'); | ||
return value == null || value === '' ? value : dayjs(value).format('YYYY-MM-DD'); | ||
} | ||
|
||
export function toDateTimeString( | ||
value: string | number | Date | Dayjs | undefined | null | ||
): DateStringValue | undefined | null { | ||
return value == null ? value : dayjs(value).format('YYYY-MM-DD HH:mm:ss'); | ||
return value == null || value === '' ? value : dayjs(value).format('YYYY-MM-DD HH:mm:ss'); | ||
Comment on lines
+7
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to the PR description, an empty string should be interpreted as null. Consider returning null instead of an empty string to ensure consistent behavior based on the docs. Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PR Description is out of date, follow up comments provide most context. |
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the PR description, an empty string should be interpreted as null. Consider returning null instead of an empty string to better align with the docs and prevent potential inconsistencies.
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR description is out of date, follow up comments are most relevant.