Calendar file import

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
reidjazz

Calendar file import

Post by reidjazz »

I'm using CMSMS 1.0.4 on an Apache 2.0 webserver. I've been attempting to take a CSV file, in the format indicated on the 'Import Events' panel in the Calendar Admin. So far, I've had 'some' success, but the date seems to always default to 30 November 2005.

I'm curious if anyone has had any success importing events into the Calendar module. What i'm really attempting to do is export from my Palm Desktop software and then import into the Calendar module, eliminating the need to enter events twice.

Any ideas are most appreciated!  ;D
Todd
rembert

Re: Calendar file import

Post by rembert »

It's easy to fix this: just edit modules/Calendar/action.admin_import.php

Line 27 should read:

Code: Select all

echo '<table border="1"><tr><td>Start time: YYYY-MM-DD hh:mm</td><td>End time: YYYY-MM-DD hh:mm</td>';
Or, in other words: ensure the date format in your CSV file matches the one in the table cms_module_calendar_events as the data is insert without any conversion or checking whatsoever. The correct format is: YYYY-MM-DD hh:mm (at least with MySQL but afaik it's the same with Postgres).

BTW: a line in the CSV file should never exceed 1000 characters - if longer, then the details will be cut-off (easy to enlarge in action.admin_import_events.php).
reidjazz

Re: Calendar file import

Post by reidjazz »

Hey, thank you very much...I just came back to this post, as I'm entering a bunch of gigs to my calendar ONE AT A TIME...glad you gave me some direction...I'll let you know how it pans out.

Thanks,
reidjazz
reidjazz

Re: Calendar file import

Post by reidjazz »

rembert wrote: It's easy to fix this: just edit modules/Calendar/action.admin_import.php

Line 27 should read:

Code: Select all

echo '<table border="1"><tr><td>Start time: YYYY-MM-DD hh:mm</td><td>End time: YYYY-MM-DD hh:mm</td>';
Or, in other words: ensure the date format in your CSV file matches the one in the table cms_module_calendar_events as the data is insert without any conversion or checking whatsoever. The correct format is: YYYY-MM-DD hh:mm (at least with MySQL but afaik it's the same with Postgres).
So, is there anyway to change the order of YYYY-MM-DD to DD-MM-YYYY? My Palm Desktop software spits out dates in DD-MM-YYYY, and I don't think I have any control over this.

reidjazz
Locked

Return to “CMSMS Core”