Created
January 8, 2017 19:36
-
-
Save jfred/dfc1168db03f577f2c7952d9c6ec3438 to your computer and use it in GitHub Desktop.
Dumb bookmarklet function for setting Slack DND until Monday morning
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var slackToken = 'GET TOKEN FROM https://api.slack.com/docs/oauth-test-tokens'; | |
var targetHr = 9; | |
var d = new Date(); | |
d.setDate(d.getDate() + (1 + 7 - d.getDay()) % 7); | |
d.setHours(targetHr); d.setMinutes(0); d.setSeconds(0); | |
var mins = (d.getTime()-new Date().getTime()) / (1000 * 60); | |
window.location='https://slack.com/api/dnd.setSnooze?token=' + slackToken + '&num_minutes=' + mins + '&pretty=1'; | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment