WordPress.org

Forums

Events Manager
[resolved] Cannot import event dates (9 posts)

  1. ukremmin
    Member
    Posted 1 year ago #

    Hi,

    I lost several days trying all kinds of permutations,
    but cannot get the import to work. Please help!

    I am using this importer: http://em.cm/importer-exporter

    With this csv-file:

    summary,post_content,location_address,location_town,location_name,location_country,location_postcode,event_start_date,event_end_date,event_start_time,event_end_time,event_all_day,event_owner
    Event_1,post content text,Hauptstr. 5,Bremen,Stadthalle,Deutschland,12345,"2013-07-27","2013-07-27","00:00:00","00:00:00",1,1

    I tried several date and time formats, but when opening the imported event,
    the dates, times and all_day_event check box are empty.

    These did not work for example:
    "2013-07-27"
    2013-07-27
    "2013-07-27 00:00:00"
    09.12.2013

    Everything else can be imported (location or event name for example), just not the date and time related entries.

    Any ideas? What is the correct date and time format? Or am I missing a database field?

    http://wordpress.org/plugins/events-manager/

  2. Philip John
    Member
    Posted 1 year ago #

    Hiya,

    Where has the importer you're using come from? I'm not aware of one so if it's not working the chances are you'd need to contact the original developer to work out any issues.

    Cheers,
    Phil

  3. angelo
    NetWebLogic Support
    Posted 1 year ago #

    haven't tried this one but will do try it and update you here though can't promise it today.

  4. ukremmin
    Member
    Posted 1 year ago #

    Hi Phil,

    this importer was mentioned by Marcus:
    http://wordpress.org/support/topic/bulk-csv-import-mass-upload

    He did not say if he tested it, though.

  5. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    i didn't. you'd need to figure that one out by playing with it yourself atm.

  6. steve098
    Member
    Posted 1 year ago #

    for the events manager bulk importer mentioned at
    http://em.cm/importer-exporter
    (WebAware.com.au?)
    The code out-of-the-box is hardcoded to start each event at midnight.
    edit this file:
    /wp-content/plugins/events-manager-import-export-0.0.3-alpha/class.EM_ImpExpImport.php

    corrected code is here (a bodge; I don't really know php)

    http://pastebin.com/SCd33zCT

    The fix is at line 480. You will see I have commented out the old regexp date match search, and also the line where the time of the event was hardcoded - for both the start and end date.
    Your CSV can then contain a start/end date in the format
    ,28/08/2013 18:00:00,28/08/2013 21:00:00,
    and this imports very well.

    (the regexp is now searching for dd/mm/yyyy hh:mm:ss)

  7. ukremmin
    Member
    Posted 1 year ago #

    Thank you! Thank you! Thank you!

    It works. What a relieve....

    For everybody else who needs to import from csv with this importer here's one hint:
    In the headline of your csv don't use the words "event_start_date" and "event_end_date" (as a look into the database would suggest), but just use "start" and "end" as column headings for the start and end dates of the event.

    Also use "summary" for the event's title.

    For the location it is different: here you use the same names as in the database (I am using a plugin called "Database Peek" to look them up).
    For example a column in your csv called "location_town" will map correctly to the location_town in the database.)

  8. steve098
    Member
    Posted 1 year ago #

    an example csv is here
    http://pastebin.com/TaEB9GBQ
    note that the column locations are not important (I think) as the importer converts the data to a named array; it is the name of the column headings (the first row) that are crucial and must match that as defined in the class.EM_ImpExpImport.php file.

    I admire this import utility's ability to handle custom event attributes and to look up existing locations

  9. ukremmin
    Member
    Posted 1 year ago #

    Ups, I produced a typo in my post above and your csv reminded me:

    This is wrong:
    "but just use "start" and "end" as column headings for the start and end dates of the event."

    Instead of "start" and "end" it is "dtstart" and "dtend"

    Sorry for that (I'm tired)

    I can confirm that the column locations are not relevant.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic