Skip to content

Instantly share code, notes, and snippets.

@nbashaw
Created June 28, 2012 17:29
Show Gist options
  • Save nbashaw/3012692 to your computer and use it in GitHub Desktop.
Save nbashaw/3012692 to your computer and use it in GitHub Desktop.
Hides Olark before 8am and after 5pm Pacific time
<script>
// Hide Olark before 8am and after 5pm Pacific time
var d = new Date();
var utcHour = d.getUTCHours();
var pacificHour = utcHour - 7;
if (pacificHour < 8 || pacificHour > 16) {
olark('api.box.hide');
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment