Skip to content

Commit

Permalink
Merge pull request civicrm#17 from dlobo/CRM-12523
Browse files Browse the repository at this point in the history
CRM-12523
  • Loading branch information
dlobo committed May 15, 2013
2 parents 0840ee4 + 49e95e3 commit 3d1a37b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions civicrm.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,16 @@ function civicrm_wp_invoke() {
return '';
}

// CRM-12523
// WordPress has it's own timezone calculations
// Civi relies on the php default timezone which WP
// overrides with UTC in wp-settings.php
$wpBaseTimezone = date_default_timezone_get();
$wpUserTimezone = get_option('timezone_string');
if ($wpUserTimezone) {
date_default_timezone_set($wpUserTimezone);
}

// Add our standard css & js
CRM_Core_Resources::singleton()->addCoreResources();

Expand Down Expand Up @@ -332,6 +342,11 @@ function civicrm_wp_invoke() {
}

CRM_Core_Invoke::invoke($args);

// restore WP's timezone
if ($wpBaseTimezone) {
date_default_timezone_set($wpBaseTimezone);
}
}

function civicrm_wp_head() {
Expand Down

0 comments on commit 3d1a37b

Please sign in to comment.