Last active
September 30, 2018 17:32
-
-
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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