Skip to content

Commit

Permalink
Merge pull request #337 from ComputerScienceHouse/develop
Browse files Browse the repository at this point in the history
Merge dev onto master
  • Loading branch information
Mstrodl authored Dec 24, 2023
2 parents 64c75fe + 5356dc2 commit ea3327f
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 41 deletions.
16 changes: 0 additions & 16 deletions .github/dependabot.yml

This file was deleted.

2 changes: 1 addition & 1 deletion api/src/S3Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class S3Manager

function __construct($S3_KEY, $S3_SECRET, $S3_SERVER, $S3_IMAGE_BUCKET) {
$this->s3Client = new S3Client([
'region' => '',
'region' => 'us-east-1',
'version' => '2006-03-01',
'endpoint' => $S3_SERVER,
'credentials' => [
Expand Down
17 changes: 15 additions & 2 deletions api/src/Schedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,20 @@ private function icalFormatTime($time) {
. "00";
}

private function firstDayAfterDate($weekday, $startDate) {
$weekdayOfStart = date('w', $startDate);
if ($weekdayOfStart > $weekday) {
// Try next week:
// 5 = 7 - 1 (we only go up to six) - 1 (we don't want to double count "today")
$startDate += 60*60*24*(5-$weekDayOfStart);
$weekdayOfStart = 0;
}
// weekday - weekDayOfStart = number of days between now and the first instance of that week day
return $startDate + (60*60*24*($weekday-$weekdayOfStart));
}

public function generateIcal($schedule) {
date_default_timezone_set('America/New_York');
// Globals
global $HTTPROOTADDRESS, $dbConn;

Expand Down Expand Up @@ -67,7 +80,7 @@ public function generateIcal($schedule) {
// This /could/ be done via the RRULE WKST param, but that means
// translating days from numbers to some other esoteric format.
// @TODO: Retrieve the timezone from php or the config file
$day = date("Ymd", $termStart + ((60*60*24)*($time['day']-1)));
$day = date("Ymd", $this->firstDayAfterDate($time['day'], $termStart));

$code .= "DTSTART;TZID=America/New_York:{$day}T{$startTime}\r\n";
$code .= "DTEND;TZID=America/New_York:{$day}T{$endTime}\r\n";
Expand Down Expand Up @@ -217,4 +230,4 @@ public function renderSvg($svg, $id) {
return false;
}
}
}
}
3 changes: 2 additions & 1 deletion assets/src/modules/sm/Search/templates/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ <h2 class="panel-title control-label pull-left">Search Courses</h2>
<div class="form-group">
<label class="control-label col-sm-4" for="search.params.description">Keywords:</label>
<div class="col-sm-8">
<input type="text" id="search.params.description" ng-model="search.params.description" name="description" class="mousetrap form-control" placeholder="(comma delmited)">
<input type="text" id="search.params.description" ng-model="search.params.description" name="description" class="mousetrap form-control" placeholder="(comma delimited)">
</div>
</div>
<div class="form-group">
Expand Down Expand Up @@ -166,6 +166,7 @@ <h2 class="panel-title control-label pull-left">Search Courses</h2>
</div>
<div class="form-group">
<select id="searchPagination-pageSize" class="form-control mousetrap" ng-model="searchPagination.pageSize">
<option value="1">1</option>
<option value="3">3</option>
<option value="5">5</option>
<option value="10">10</option>
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
}
],
"require": {
"php": ">=7.1",
"php": ">=7.3",
"aws/aws-sdk-php": "^3.69",
"ext-imagick": "*",
"ext-json": "*"
Expand Down
21 changes: 11 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,25 +49,26 @@
},
"homepage": "https://schedule.csh.rit.edu",
"devDependencies": {
"@datadog/browser-rum": "^3.6.10",
"@datadog/browser-rum": "^4.8.1",
"@types/angular": "1.5",
"@types/google.analytics": "0.0.42",
"@types/mousetrap": "^1.6.8",
"@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0",
"@types/mousetrap": "^1.6.9",
"@typescript-eslint/eslint-plugin": "^5.21.0",
"@typescript-eslint/parser": "^5.21.0",
"del": "^6.0.0",
"eslint": "^7.32.0",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.24.2",
"eslint": "^8.14.0",
"eslint-config-standard": "^17.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-n": "^15.2.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-standard": "^5.0.0",
"event-stream": "^4.0.1",
"gulp": "^4.0.2",
"gulp-concat": "^2.6.1",
"gulp-htmlmin": "^5.0.1",
"gulp-jshint": "^2.1.0",
"gulp-less": "^4.0.0",
"gulp-less": "^5.0.0",
"gulp-minify-css": "^1.2.4",
"gulp-ng-annotate": "^2.1.0",
"gulp-rename": "^2.0.0",
Expand All @@ -77,7 +78,7 @@
"gulp-typescript": "^5.0.1",
"gulp-uglify": "^2.0.0",
"install": "^0.13.0",
"typescript": "^4.4.3",
"typescript": "^4.6.4",
"vinyl-paths": "^3.0.0"
}
}
19 changes: 9 additions & 10 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"include": [
"./assets/src/modules/sm/**/*.ts"
],
"exclude": ["./node_modules"],
"compilerOptions": {
"module": "es2015",
"allowJs": false,
"noImplicitAny": false,
"target": "es5",
}
"include": ["./assets/src/modules/sm/**/*.ts"],
"exclude": ["./node_modules"],
"compilerOptions": {
"module": "es2015",
"moduleResolution": "node",
"allowJs": false,
"noImplicitAny": false,
"target": "es5"
}
}

0 comments on commit ea3327f

Please sign in to comment.