[Résolu] Data entry in date fields without datepicker
This support ticket is created Il y a 8 années et 4 mois. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
Instead of using the datepicker we would prefer to copy/paste dates into date fields. As far as we can see this field type does not allow this. Any suggestions?
(We still want it to be a date field to use validation and formatting options, so we don't want to convert date fields into text fields.)
It should do the trick disabling the Date Picker and enabling field for input. However, you must input the dates as the format was used by the Date Picker, so these are saved correctly.
Please let me know if I can help you with anything related.
My question is not related to the datepicker in CRED forms but in standard backend forms which are provided by the Types plug-in.
However, you are mentioning the date format. If I am having a look at the raw data in the database, my dates look like "1349395200" or even "-62208000". What format is that? Where can I find documentation on this?
I am able to answer the second half of my question myself: These (positive or negative) integer values are in the Unix timestamp format. So obviously it would not help to remove the datepicker if the users had to enter dates in this format. But it would help a lot if they could enter dates like "27.03.2015" or "2015-03-27". Any ideas?
Yes, Types saves date type data as unix timestamp, while it takes input as a human readable format (i.e. "27.03.2015" or "2015-03-27"). So it doesn't matter if you disable the date-picker, all you need to input the date in the text field, as you have after selecting from the date-picker. So when form is submitted, Types takes care of it.
Storing dates in unix timestamp format, makes it highly searchable. Specially, when you want to apply date operations (between, from - to, days diff and etc). This is a standard among database storages.
Thank you for your answer, this should solve our problem for the moment. However it would be nice if the next version of Types could offer a checkbox "Display date picker" when defining a date field.
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.