Skip to content

Instantly share code, notes, and snippets.

@alexwoollam
Last active September 30, 2018 17:32
Show Gist options
  • Save alexwoollam/c66bd9df319347206022be522f191cc8 to your computer and use it in GitHub Desktop.
Save alexwoollam/c66bd9df319347206022be522f191cc8 to your computer and use it in GitHub Desktop.
Fixes Time.ly ai1ec GMT/BST issues, (events being a day behine in summer)
/**
* Get start and end of BST.
*/
$bst-month = date( 'Y/03/d', strtotime('last sunday of march' ) );
$gmt-month = date( 'Y/10/d', strtotime('last sunday of october' ) );
$event_date_sanitized = $datetime->format( 'Y/m/d' );
if ( $result->allday ){
if ( $event_date_sanitized >= $bst-month && $event_date_sanitized <= $gmt-month ){
$datetime->modify( '+1 day' );
$bstorgmt = 'bst';
} elseif ( $event_date_sanitized >= $gmt-month ) {
$datetime->modify( '+0 day' );
$bstorgmt = 'gmt';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment