Currently playing with Grav and pages forms, I’m having a hard time with date and datetime fields.
First of all, I’m not totally sure of what I should expect from the date field. Right now, it just looks like a text field but maybe I’m just using it wrong.
I’m also trying to use datetime fields nested into a list field. Something like the header.buttons in the showcase.yaml form from antimatter. The problem is that once nested, it just looks like any other text field. I suspect it’s an expected behaviour but if you got any ideas on how to achieve that, I would be glad.
Hi, post some blueprints examples here (properly formatted by using triple dashes or triple backticks) and tell what you expect / what is happening so I can add them to the theme and check.
For the first question, I used something like this:
date:
type: date
label: Date
name: date
Actually, I don’t really know what to expect as I didn’t find any use of the date type in antimatter or in the system blueprints. I think I expected something like a “select a date in a calendar” field but I just got a regular text field where I can write text and without any “valid/unvalid” behaviour.
About the nested list>datetime, my form is similar to this:
dates:
label: Dates
name: dateslist
type: list
fields:
datein:
type: datetime
label: Date in
name: datein
dateout:
type: datetime
label: Date out
name:dateout
I use the list so I can add a undefined amount of datein/dateout couples to a page. It seems to work quite well within the button tab of antimatter>showcase blueprint.
Usually, when I use the datetime field, I have a calendar/time selector but once nested, It becomes a regular text field, leaving me unable to pick a date.
As for datetime fields in lists, not yet supported due to more JS needed to render them. Hopefully will be supported in the next admin javascript iteration we’re doing.