Skip Navigation

[Resolved] Identify start date and end date

This support ticket is created 5 years, 5 months ago. 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.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 1 reply, has 2 voices.

Last updated by Christian Cox 5 years, 5 months ago.

Assisted by: Christian Cox.

Author
Posts
#1174293
Snap 2018-12-28 at 17.49.57, 316x251.png

I migrated a Drupal site to WordPress and some of the imported custom post types originally had a date field that can either have a simple date or a start date and an end date. What I have now in my import is a date filed that has two entries. Is there a way to ignore the second date if it is identical with the first and/or define the first date as a start date and the second as an end date?

Thanks in advance,

Jannis

#1174836

Is there a way to ignore the second date if it is identical with the first and/or define the first date as a start date and the second as an end date?
Hi, unfortunately there's nothing built in to Toolset that will help split repeating field values into other single field values. Are you using a CSV file to import your content? If so, then you can create two new custom date fields in Types - one for start date and another for end date. Then edit the CSV file manually before import. Copy all the old date values to use as the new start date field values. Then find any new start date fields with multiple date values. Cut the second date value and paste it in the new end date field value. During your import process, do not map the old date field to anything in Toolset. Instead, map the new start and end date fields. It's a tedious process, but it could be accomplished without any custom code.

Or if you're comfortable writing code, a custom SQL database script could loop over all the posts that have this date field, and transpose the existing field values into the new start and end date fields. I can show you how to access any custom field in the database, but the SQL code itself is outside the scope of support we provide here.

This ticket is now closed. If you're a Toolset client and need related help, please open a new support ticket.