Closed joesb closed 5 years ago
@joesb - You can add any arbitrary HTML attributes to the inputs exported from the editor
package. Could you try adding the type
attr set to date
in the input function?
for example:
editor.Field{
View: editor.Input("StartDate", p, map[string]string{
"label": "StartDate",
"type": "date",
"placeholder": "Enter the Author here",
}),
},
Thanks for this. I'll have a got and see how far I get.
@joesb - any luck? going to close out this issue unless you're having problems with it :)
Sorry @nilslice - I've not had a chance to get onto it again since asking. Gah!
Do please feel happy closing this issue and I can always ask more questions at a later date. Thanks a gazillion for your help.
No worries -- I'll leave it open, not a problem at all. Happy to help!
@nilslice Your solution worked perfectly for me.
Closing this issue. It appears to be answered/resolved. Please reopen if not the case.
I'm wondering how to create a content field for a datetime e.g. opening/closing dates of an event. Ideally it would be formatted into year, month, day (etc.) fields in the UI – taking some inspiration from the content publishTime UI, maybe. Granularity of field elements might be adaptable in some way.
Any resources or pointers on how to do it? (I'm new to Go and Ponzu, and hoping to learn some Go by working with Ponzu.)
Many thanks, in anticipation.