diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2019-07-13 13:08:46 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2019-07-13 13:08:46 +0200 |
| commit | ef4dc4ec09cc25df4120105935500a0e2cbc67ac (patch) | |
| tree | 65680411fa523c56335320f6c1e8a6aabf6c1322 | |
| parent | 034c7fe0d9024474d262942bf17792343480917c (diff) | |
weeks
| -rw-r--r-- | public/assets/js/lib/views/index/countdown.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/public/assets/js/lib/views/index/countdown.js b/public/assets/js/lib/views/index/countdown.js index f2fd666..6020e9d 100644 --- a/public/assets/js/lib/views/index/countdown.js +++ b/public/assets/js/lib/views/index/countdown.js @@ -27,9 +27,17 @@ var Countdown = View.extend({ now /= 60 var hours = Math.floor(now % 24) now /= 24 - var days = Math.floor(now) + var days = Math.floor(now % 7) + now /= 7 + var weeks = Math.floor(now) var date_string = [ - "<big><b>", days, 'days</big></b>', + '<big><b>', + (weeks ? ( + (weeks && days) ? weeks + ' weeks,' : weeks + ' weeks' + ) : '' + ), + (days ? days + ' days' : ''), + '</big></b>', hours, 'hours,', minutes, 'minutes,', seconds, 'seconds', |
