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

Fixed #5363 -- HTML5 datetime-local valid format HTMLFormRenderer #9365

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mgaligniana
Copy link
Contributor

@mgaligniana mgaligniana commented Apr 4, 2024

Description

Hi!

This PR deletes the [milli|micro]seconds part of a DateTimeField input at HTMLFormRenderer to avoid break in browsers:

image

refs #5363

@mgaligniana
Copy link
Contributor Author

Hi @auvipy! Following your comment on #5363 (comment) I ask if you could do the review! Thank you!

@auvipy auvipy self-requested a review May 27, 2024 16:08
@auvipy auvipy requested a review from a team June 10, 2024 07:08
# The format of an input type="datetime-local" is "yyyy-MM-ddThh:mm"
# followed by optional ":ss" or ":ss.SSS", so remove [milli|micro]seconds
# to avoid browser error.
field.value = "".join(field.value.rstrip('Z').split(".")[:1])
Copy link
Contributor

Choose a reason for hiding this comment

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

The millisecond part should be retained, as it's a valid part of the format.

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.

None yet

2 participants