File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
web/app/plugins/mitlib-pull-hours/js Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -207,9 +207,20 @@ var HoursLoader = {
207
207
// For each date in the week...
208
208
_ . each ( testweek , function ( dayofweek ) {
209
209
testday = new Date ( dayofweek ) ;
210
- rebuildsemester = [ ] ;
210
+ // Define default vales, in case testday is beyond the range of defined semesters.
211
+ // Ideally these would be calculated from the Default Hours sheet.
212
+ semester_cache = 'Default-Hours.json' ;
213
+ testday . semestername = "Default Hours" ;
214
+ testday . start = '1/1/1970' ;
215
+ testday . end = '12/31/2100' ;
216
+ rebuildsemester = [
217
+ 'Default Hours' ,
218
+ '1/1/1970' ,
219
+ '12/31/2100' ,
220
+ 'Default-Hours.json'
221
+ ] ;
211
222
// Cycle through each term, determining which it belongs to.
212
- // (This is inefficient, I know...)
223
+ // (This is inefficient, I know... - could be _.every() with a break or return? )
213
224
_ . each ( testsemesters , function ( semester ) {
214
225
semester_start = new Date ( semester [ 1 ] ) ;
215
226
semester_end = new Date ( semester [ 2 ] ) ;
You can’t perform that action at this time.
0 commit comments