Skip to content

Instantly share code, notes, and snippets.

@mjwhansen
Created April 21, 2021 08:46
Show Gist options
  • Save mjwhansen/7a559e114fcce710dcc740cec02c5b8a to your computer and use it in GitHub Desktop.
Save mjwhansen/7a559e114fcce710dcc740cec02c5b8a to your computer and use it in GitHub Desktop.
Scheduling link redirect based on timezone
var gmtOffset = - new Date().getTimezoneOffset() / 60;
if (gmtOffset >= -11 && gmtOffset <= -6) {
window.location.href='#';
} else if (gmtOffset <= -4) {
window.location.href='#';
} else {
window.location.href='#';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment