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 format error on test logs. #625

Open
bitfieldfarm opened this issue Jan 11, 2023 · 5 comments
Open

Date format error on test logs. #625

bitfieldfarm opened this issue Jan 11, 2023 · 5 comments
Labels

Comments

@bitfieldfarm
Copy link

Adding a soil sample
When adding a soil sample, and setting a processed or recieved date, there's a date format error.
This is with European date format.

bilde

The date is selected from the calendar.

@mstenta
Copy link
Member

mstenta commented Jan 11, 2023

I'm unable to replicate this @bitfieldfarm.

What browser are you using? I tried in Firefox, and mine looks a little different (no little calendar icon):

Screenshot from 2023-01-11 09-22-45

All of these date inputs (including the log's main timestamp field at the top) use HTML5 date input elements. So the browser is responsible for how they are rendered and how they behave. That said, maybe there is some kind of configuration in Drupal/farmOS that is incorrect, but as far as I can tell we're just using the defaults. There may be more to this... 🤔

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date

Curious: do you have the same issue when you try the example in that link?

@mstenta
Copy link
Member

mstenta commented Jan 11, 2023

I'm pretty sure I remember something else coming up related to these date pickers in the past, but I wasn't able to quickly find the issue in our queues/forum... I will paste it here if I do.

@bitfieldfarm
Copy link
Author

Hah.. Didn't pay notice to this, but the screenshot with calendar picker is from Brave.
Actually a nice time picker too.
bilde

In Firefox I have the same date/time fields as you. But still get the error.

But I see now that if I fill the time field too, it works.
Time is prefilled in the log timestamp so never a problem there...

@mstenta maybe time field in this case could be prefilled and hidden?

@paul121
Copy link
Member

paul121 commented Feb 1, 2023

I'm able to replicate this in both Brave and Firebox. This happens if a date is provided without a time when the form is submitted. It is not clear in the UI that both the date and time are required until the error message is shown (and even this this isn't a great error message):

The Date received date is invalid. Please enter a date in the format 2023-01-31 16:55:58.

This also happens for the animal birth date timestamp field. I'm not sure of an easy fix... it's not so much an "issue" as it is poor UX.

I'm pretty sure I remember something else coming up related to these date pickers in the past,

We did add the datetime_timestamp_optional field widget.. there was a bug where the current time would be submitted for fields in entity forms even if the user did not populate values: 79693d2. But I do not think that is related to this issue.

@mstenta
Copy link
Member

mstenta commented Feb 3, 2023

I was digging for a different bug in the Drupal core issue queue and found this, which sounded related - not sure if it is or not, but I'll drop it here anyway: https://www.drupal.org/project/drupal/issues/2723159

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants