This repository was archived by the owner on May 29, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 88 define ('TOOL_START_PAGE ' , 'index.php ' );
99}
1010
11+ define ('SCHOOL_TIME_ZONE ' , 'America/New_York ' ); // Go Sox! Stupid PHP.
12+
1113define ('DATA_COLLECTION_CRONTAB ' , '0 0 * * * ' ); // collect data every night at midnight
1214
1315/* graph coloring (tied into CSS styling of summary text, so be sure to use
Original file line number Diff line number Diff line change @@ -121,13 +121,18 @@ function collectStatistics($term) {
121121
122122 // check for due dates
123123 $ dueDate = new DateTime ($ assignment ['due_at ' ]);
124+ $ dueDate ->setTimeZone (new DateTimeZone (SCHOOL_TIME_ZONE ));
124125 if (($ timestamp - $ dueDate ->getTimestamp ()) > 0 ) {
125126 $ statistic ['assignments_due_count ' ]++;
126127
127128 // update created_modified_histogram
128- $ createdModifiedHistogram [HISTOGRAM_CREATED ][date ("g:00 a " , strtotime ($ assignment ['created_at ' ]))]++;
129- if ($ assignment ['updated_at ' ] != $ assignment ['created_at ' ]) {
130- $ createdModifiedHistogram [HISTOGRAM_MODIFIED ][date ("g:00 a " , strtotime ($ assignment ['updated_at ' ]))]++;
129+ $ createdAt = new DateTime ($ assignment ['created_at ' ]);
130+ $ createdAt ->setTimeZone (new DateTimeZone (SCHOOL_TIME_ZONE ));
131+ $ updatedAt = new DateTime ($ assignment ['updated_at ' ]);
132+ $ updatedAt ->setTimeZone (new DateTimeZone (SCHOOL_TIME_ZONE ));
133+ $ createdModifiedHistogram [HISTOGRAM_CREATED ][$ createdAt ->format ('g:00 a ' )]++;
134+ if ($ createdAt != $ updatedAt ) {
135+ $ createdModifiedHistogram [HISTOGRAM_MODIFIED ][$ updatedAt ->format ('g:00 a ' )]++;
131136 }
132137
133138 // tally lead time on the assignment
You can’t perform that action at this time.
0 commit comments