Skip to content
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

DateTimePicker sets seconds to new Date() when updating time value, when withSeconds is not specified #4737

Closed
samcarton opened this issue Sep 7, 2023 · 1 comment
Labels
Fixed patch Completed issues that will be published with next patch (1.0.X)

Comments

@samcarton
Copy link

What package has an issue

@mantine/dates

Describe the bug

  • Using DateTimePicker, and withSeconds={false}
  • Put console log on the onChange
  • Select a date and an hour/minute time
  • Notice that the date being selected has seconds equal to new Date() seconds (i.e. the current times' seconds)
  • I would expect the seconds to default to zero

What version of @mantine/hooks page do you have in package.json?

6.0.19

If possible, please include a link to a codesandbox with the reproduced problem

No response

Do you know how to fix the issue

Yes

Are you willing to participate in fixing this issue and create a pull request with the fix

Yes

Possible fix

seconds !== undefined && timeDate.setSeconds(seconds);

Change ☝️ to seconds === undefined ? timeDate.setSeconds(0) : timeDate.setSeconds(seconds);

@rtivital rtivital added the Fixed patch Completed issues that will be published with next patch (1.0.X) label Sep 21, 2023
@rtivital
Copy link
Member

The issue is resolved in 7.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed patch Completed issues that will be published with next patch (1.0.X)
Projects
None yet
Development

No branches or pull requests

2 participants