mirror of
https://github.com/zhigang1992/probot.github.io.git
synced 2026-01-12 22:49:53 +08:00
Merge pull request #212 from probot/fix-office-hours-nag
Advance to next week if start is past
This commit is contained in:
@@ -5,10 +5,14 @@ var debug = false;
|
||||
|
||||
// Adjust to Thursday at 17:00 UTC / 1pm EDT
|
||||
var attrs = {day: "Thursday", hour: 17, minute: 0, second: 0, millisecond: 0}
|
||||
|
||||
var start = moment().utc().set(attrs)
|
||||
var end = start.clone().add({hour: 1})
|
||||
|
||||
// If it's already passed today, go to the next occurrence
|
||||
if(start < moment()) {
|
||||
start.add({days: 7})
|
||||
}
|
||||
|
||||
var end = start.clone().add({hour: 1})
|
||||
|
||||
if(debug || start < moment().utc().add(4, 'hours')) {
|
||||
document.body.classList.add('office-hours-soon')
|
||||
|
||||
Reference in New Issue
Block a user