Skip to content

Commit

Permalink
Add some helper functions
Browse files Browse the repository at this point in the history
  • Loading branch information
John P. Bloch committed May 7, 2014
1 parent b0c813d commit 6245194
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions live-cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,19 @@
return Math.max(rate, 60);
}

function formatTimestampEndpoint(int) {
return ('000000' + parseInt(int, 10)).slice(-6).substr(0, 5);
}

function int_to_timestamp(int) {
int %= 86400;
var timestamp = [];
timestamp[0] = ('00' + Math.floor(int / 3600)).slice(-2);
timestamp[1] = ('00' + Math.floor((int % 3600) / 60)).slice(-2);
timestamp[2] = ('00' + (int % 60)).slice(-2);
return timestamp.join('');
}

this.auto_updates = LC.auto_updates;

// schedule first check
Expand Down

0 comments on commit 6245194

Please sign in to comment.