[datetime-field_type] Possible to disable the picker on form?
Created 6 years ago by emergingdzns

Is it possible to disable the date picker on datetime fields when the module form builder loads the form up? I have a client that is unhappy with how the date picker works and wants to just be able to enter the date with the input mask for the format mm/dd/yyyy. I would make it a text field but we want the actual data type in the db to be a date field, not a varchar. Thoughts?

ryanthompson  —  6 years ago Best Answer

There is a picker boolean config you can use to disable it: https://pyrocms.com/documentation/datetime-field-type/3.0/introduction/configuration

I just updated the documentation - looks like it was missing:

'picker' => false
emergingdzns  —  6 years ago

Oh thank you!

emergingdzns  —  6 years ago

Ok so now that I have picker disabled, is it possible to have a simple input mask and NOT the whole scrolly numbers thing? I can't just click on the field and type out the full date. I have to click on each set of numbers in the mm/dd/yyyy format and then I can type each section. The old fashioned input mask //____ would be nice. Thoughts?

ryanthompson  —  6 years ago

The text input has a mask feature. Then you can use carbon(entry.foo.value) or something similar to pull it out later. Just won't be stored as a date/time column in the DB.

emergingdzns  —  6 years ago

Not sure that will work. Dang. There's no way to turn off that feature? Is there a js switch or something I can override it with?

ryanthompson  —  6 years ago

It's how the plugin was built :-/