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

Date field sets random milliseconds #6108

Open
CherryDT opened this issue Apr 29, 2024 · 0 comments · May be fixed by #6259
Open

Date field sets random milliseconds #6108

CherryDT opened this issue Apr 29, 2024 · 0 comments · May be fixed by #6259
Assignees
Labels
[possible-bug] Possible bug which hasn't been reproduced yet

Comments

@CherryDT
Copy link

Link to reproduction

No response

Describe the Bug

I have a date field set to show the time with a precision up to seconds, using settings such as:

date: {
  pickerAppearance: 'dayAndTime',
  dateFormat: 'dd.MM.yyyy',
  timeFormat: 'HH:mm:ss',
  displayFormat: 'dd.MM.yyyy HH:mm:ss'
}

When I select a time such as 12:00:00 then it ends up setting "random" milliseconds in the date value too (I get for example 2024-04-29T10:00:00.613Z, note the extra 613 milliseconds). (These are probably not random but a leftover of the number of milliseconds at the current system time.)

Unspecified date/time parts should be set to zero.

To Reproduce

Create a date field as shown above. Set a time. Observe the non-zero milliseconds in the actual field value.

Payload Version

2.14.2

Adapters and Plugins

db-mongodb, bundler-webpack

@CherryDT CherryDT added the [possible-bug] Possible bug which hasn't been reproduced yet label Apr 29, 2024
@PatrikKozak PatrikKozak self-assigned this May 7, 2024
@PatrikKozak PatrikKozak linked a pull request May 7, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[possible-bug] Possible bug which hasn't been reproduced yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants