We need to be able to select dates before 1583. I see conflicting response to this problem. https://toolset.com/forums/topic/in-date-picker-select-years-before-1583/ that sys the issue will be solved in Types 2.3 and others that says it can't be done. How can we migrate the data from a date field into some other custom field format?
Please provide all the relevant details here:
- What type of field will you convert to?
- What will be the new field slug?
- Do you have any Views that utilize this date field as a filter, or for sorting criteria?
- Are there any conditional HTML shortcodes that rely on this date field?
- Where can I find your data export files?
OK
- What type of field will you convert to?
SINGLE LINE TEXT FIELD FOR POSTE TYPE DEFINITIONS hidden link
- What will be the new field slug?
EVENEMENT-DATE-2
- Do you have any Views that utilize this date field as a filter, or for sorting criteria?
DEFINITIONS
- Are there any conditional HTML shortcodes that rely on this date field?
NOT THAT RELY ON THE DATE FILED BUT THE DATE FIELD HAS A CONDITIONAL DISPLAY
Conditional display
Definitions Categories = Evenement
- Where can I find your data export files?
HAVEN'T EXPORTED ANYTHING
- Do you have any Views that utilize this date field as a filter, or for sorting criteria? DEFINITIONS
I see a View called "Definitions lies a un Mot", but it is not filtered or sorted by the custom date field. I see another View called "Definitions Mots", but it is not filtered or sorted by the date field. Perhaps there was a miscommunication? If any Views are sorted or filtered by the event date custom field, we need to consider that before the data migration.
Okay thank you. Now we need to discuss date formats.
1. What format do you want to use to store dates in the database?
2. What format do you want to use to display the dates on the front-end of the site?
Let me explain some options. If you do not plan to use these dates for sorting, comparison, or filtering, then storing the dates as dd/mm/yyyy or some other readable format is fine. However, if you plan to use dates for sorting, comparison, or filtering, then you must use a different format, like Unix timestamp. Toolset's date fields use this format. For example, right now, the Unix timestamp is 1567107876. A tool like this can help you convert dates to timestamps: https://www.epochconverter.com/
This format allows easy sorting and comparison of dates, but it is not easily readable. To display that timestamp in a readable date format, you can use a custom shortcode:
We will not use these dates for sorting, filtering or comparison.
Just to recap.
1. We are talking about the custom field "date" for Definitions post type.
2. As we need BC dates we cannot continue to use the date picker field because it is limited to the Gregorian calendar and the dev. team doesn't advice to change the core code with another epoch number.
3. we are creating a new field - Single Line with the slug "EVENEMENT-DATE-2" that will be used to enter the date as we wish.
4. You are helping us to convert the existing date picker entries to a "single line" text as this will be the new format.
5. This field "EVENEMENT-DATE-2" will not be used for filtering, sorting or comparison.
6. The existing data can be converted as DD/MM/YYYY.
Am I following well?
Just a question why a new slug? why can't we converted the existing data and keep the same slug for the single line field?
Yes, your recap summary is accurate. We will continue with date format DD/MM/YYYY.
Just a question why a new slug? why can't we converted the existing data and keep the same slug for the single line field?
That would be a more complicated process. The existing field would have to be deleted before the migration can take place. That would delete all the existing values from the database. It's possible, but more complicated. For the purposes of this ticket, I would prefer to create a new field and move the values there first.
Please create the single-line text field "EVENEMENT-DATE-2" in the custom field editor. Then, create a SQL dump file from your database and post it somewhere like Dropbox or Drive, where I can download it. I will import that database locally and create the required scripts for migrating the custom field values. I'll make sure everything is working correctly locally before we update the production database.
Maybe I'm misunderstanding but this database only has one entry for the original field - wpcf-evenement-date - in post #5059. Is there more date information in a different field?
Really! Sorry I am not the one entering data, I was told by the client that this was an issue and that data had been entered. I should have checked before moving forward and "wasting" your time. My apologies. I'll let him know to update manually.