V2 Add Animal date and time error

This is probably in the wrong place, feel free to move it. I am trying to add animals but I keep getting this error:

Error message

The Birthdate date is invalid. Please enter a date in the format 2022-01-09 11:25:05 .

However, that format is not an option on my screen. I even tried to use the supplied calendar drop menu and it still has that error.

i am using https://kkbee.farmos.net/asset/add/animal

1 Like

I actually just came across the same issue.
I was just entering birth date. Seems you need to also fill the time for the date to be accepted.

my default time format is dd/mm/yyyy but the error also suggests yyyy-mm-dd hh:mm:ss, just filling in a time allowed birth date to be accepted.

1 Like

I tried that, it still tells me that the date format is backwards. The date block does not offer the y/m/d, only m/d/y. Right below the date block is this msg : Format: 2022-01-09 14:19:00 .

but I can’t do it that way, lol

1 Like

Ah… well I’m sure some one more knowledgeable will be along shortly.
Like yours mine looked like it was complaining about the format being backwards too, but the issue was actually something else.

1 Like

I actually tried to follow your tut on install FarmOS in RPi (thanks for it). I couldn’t figure it out so I just bought a subscription, lol. All I ever got to show was the nginx or apache welcome page, lol. Hopefully, the folks on here can hold me hand as I walk this journey, lol. It’s gonna be interesting, fer sure!

1 Like

That tutorial is out of date now, I’ve added a warning to the top of it. I’m doing a new one now as I’ve migrated my setup to farmOS 2.x .

It’s actually a bit more straight forward. But you’ll not need it now anyway.

1 Like

I don’t “need” it, but I’m still gonna try it anyway, lol. I have a pi just sitting here, and I am determined to work it out now, lol. Looking forward to it, thanks for the hard work!!

P.S. The original topic of this post seems to be working now. Either it got fixed or that popping sound I heard earlier wasn’t what I though it was…Thanks!!

2 Likes

Thanks for mentioning this @Nod - I believe @Farmer-Ed is correct here. Reminds me of this upstream Drupal core issue: https://www.drupal.org/project/drupal/issues/2791693

Quoting the issue description - it’s hard display a date format in the help text because “the implementation of this datepicker is up to the browser vendor, as the HTML5 specification does not tell vendors how to implement the input’s UI.”

1 Like

Good eyes @Nod and @Farmer-Ed ! We noticed this inconsistency a while back, but forgot about it. It’s not “critical” so didn’t get attention before beta. Would love to find a good solution now!

In my mind there are two separate things to fix:

  1. The upstream Drupal core issue that @paul121 linked to above (https://www.drupal.org/project/drupal/issues/2791693) - hopefully this gets fixed upstream so that we don’t have to!
  2. Right now farmOS date fields also require a time to be specified.

I’ve always wanted to simplify the second issue, by somehow making the “time” optional. The workaround is to basically just enter 12:00:00 as the time. I would love to see a “smarter” widget for date/time selection that hid the time by default (and defaulted to 12:00:00) but allowed you to “Add a time” and that would let you customize it further.

In many cases a time is not necessary. But in some contexts it is! So farmOS uses “timestamp” fields for most date storage, because it provides that granularity. So it’s really just a matter of massaging the UI to make it easier to work with “date only” data.

1 Like

To summarize the “correct” way to use the date field (for anyone else who runs into this issue)…

  • Use the popup calendar to select the date. This will populate the text fields in the way they should be.
  • Add a time, even if it is just 12:00:00
  • Ignore the format described in the help text :wink:

@paul121 Maybe we should just remove that help text to avoid confusion. Apart from the time part being required, the popup calendar works intuitively without help text I think.

Making the time optional would be another good improvement. Those two combined would ease this quite a bit IMO.

2 Likes

Glad you have that issue sorted now.

Even with a subscription, it is no harm to have a test server to test new things.
I put up a new version on my Blog if you want to guinea pig it. I’ve split it into 2 parts, so you can try it without SSL/Nginx first and then work from there. It probably still needs a little tidying.

2 Likes