Skip to content

Commit 5356dc2

Browse files
committed
explicitly set timezone
1 parent 8e8a504 commit 5356dc2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

api/src/S3Manager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class S3Manager
2020

2121
function __construct($S3_KEY, $S3_SECRET, $S3_SERVER, $S3_IMAGE_BUCKET) {
2222
$this->s3Client = new S3Client([
23-
'region' => '',
23+
'region' => 'us-east-1',
2424
'version' => '2006-03-01',
2525
'endpoint' => $S3_SERVER,
2626
'credentials' => [

api/src/Schedule.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,16 @@ private function firstDayAfterDate($weekday, $startDate) {
2626
$weekdayOfStart = date('w', $startDate);
2727
if ($weekdayOfStart > $weekday) {
2828
// Try next week:
29-
$startDate += 60*60*24*(7-$weekDayOfStart);
29+
// 5 = 7 - 1 (we only go up to six) - 1 (we don't want to double count "today")
30+
$startDate += 60*60*24*(5-$weekDayOfStart);
3031
$weekdayOfStart = 0;
3132
}
3233
// weekday - weekDayOfStart = number of days between now and the first instance of that week day
3334
return $startDate + (60*60*24*($weekday-$weekdayOfStart));
3435
}
3536

3637
public function generateIcal($schedule) {
38+
date_default_timezone_set('America/New_York');
3739
// Globals
3840
global $HTTPROOTADDRESS, $dbConn;
3941

0 commit comments

Comments
 (0)