I am unable to download the calendar
http://localhost:8080/calendarmodule/calendar-created/ical/2012-05/calen...

Exception: DateTimeZone::__construct() [datetimezone.--construct]: Unknown or bad timezone (1) in DateTimeZone->__construct() (line 203 of D:\wamp\www\calendarmodule\sites\all\modules\date\date_api\date_api.module).

Robs

Comments

karens’s picture

Project: Calendar » Date iCal
Version: 7.x-3.x-dev » 7.x-1.x-dev

Wrong issue queue.

lijiapeng’s picture

I have the same issue. Having a really hard time tracing where it's going awry. Using D7.14, date ical 7.x-1.1.

coredumperror’s picture

Status: Active » Closed (cannot reproduce)

Is anyone still suffering from this issue? If so, please try the new 7.x-2.x build, and open a new issue against that branch if this problem persists.

supradhan’s picture

Same problem in 7.x-2.7.
Unknown or bad timezone: Eastern Standard Time while importing and no node created.

supradhan’s picture

Version: 7.x-1.x-dev » 7.x-2.7
Status: Closed (cannot reproduce) » Active
coredumperror’s picture

Hmmm, that's odd.

Could you please copy-paste the entire error message? The best I can guess, without it, is that your site may somehow be set up to treat the string "Eastern Standard Time" as a timezone string, which it is not. The correct string to represent eastern time is "America/New_York".

supradhan’s picture

I exported ics file from my MS outlook 2010 and used feeds importer to import entries. Initially it was giving error: Unknown or bad timezone: Eastern Standard Time. But after your comment, I changed 'Eastern Standard Time' to 'America/New_York' and it imported the entry but it is without start/end date. I know my mapping is fine but some reason it is not working.

coredumperror’s picture

Could you attach the .ics file here, so I can take a look at it? It sounds like outlook might be outputting it in an unexpected format.

supradhan’s picture

StatusFileSize
new1.63 KB

Thank you for quick response.

I have attached my ics file.

coredumperror’s picture

Hmm, it looks like your ICS file is still using "Eastern Standard Time" as the timezone name. What method did you use to apply the change you mentioned in #7?

I think you may be seeing this latest problem because you (I think?) changed the VTIMEZONE element, but didn't change the timezone that each VEVENT's DTSTART and DTEND properties were referring to. If you do a search-and-replace across the whole file, switching "Eastern Standard Time" to "America/New_York", that should fix it. If it doesn't, then you've probably found a bug in Date iCal, and I'll look into it as soon as I get a chance.

supradhan’s picture

StatusFileSize
new131.01 KB
new6.04 KB

Thank you.

Actually I replaced all but i attached the original one in previous post. Here is the renamed one. It gets 'summary' and 'description' but dates are blank. I have also attached the screenshot of my mapping.

coredumperror’s picture

I found the problem: #1989196: Never Pass FeedsDateTime objects into date_create.

That issue brings to light a bug in Feeds (which was fixed in the latest dev version), which was causing your second problem. Annoyingly, though, the batch system that Drupal uses hides the warning that was being generated by that Feeds bug. If you check your site's log (admin/reports/dblog), you'll probably see many of these:

Warning: date_create() expects parameter 1 to be...

Those are the warnings which were being hidden by Drupal during the Feeds import process. To fix this problem, update your Feeds module to the latest dev version.

As for the initial problem with "Eastern Standard Time", I looked for a way to upgrade Date iCal to handle that, but due to the way that Date iCal and Feeds interact, I wasn't able to make a simple fix. So, I decided to define a new hook, which you can implement to fix that problem. Upgrade to the newest version of Date iCal (7.x-2.8), then define the following function in one of your modules:

function YOUR_MODULE_NAME_date_ical_timezone_alter(&$tz_string, &$context) {
  if ($tz_string == 'Eastern Standard Time' || $tz_string == 'Eastern Daylight Time') {
    // "Eastern Standard Time" is a deprecated timezone string, which PHP doesn't
    // recognize. It's (essentially) equivalent to "America/New_York", though,
    // which PHP is fine with.
    $tz_string = 'America/New_York';
  }
}

Then clear your site's cache (drush cc all, or go to admin/config/development/performance and click "Clear all caches"), then attempt your iCal import again.

P.S. I've pushed the 7.x-2.8 tag up to Drupal's git repo, but for some reason it's not allowing me to actually create the release. I'll try to create the release tomorrow, but if you want to get the code right away, you can use git to pull the latest code from git clone --branch 7.x-2.x http://git.drupal.org/project/date_ical.git

supradhan’s picture

Thank you coredumperror.
That is really helpful. I really appreciate it. I will try to implement these solutions today.

supradhan’s picture

Status: Active » Closed (fixed)