Skip to content

Commit

Permalink
Set to offline mode, add formatTime filter
Browse files Browse the repository at this point in the history
  • Loading branch information
guoguo12 committed May 24, 2017
1 parent 7ff5ff4 commit 7e26d96
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
</div>

<div class="container" id="main" v-cloak>
<div class="row box warning" v-if="offline">
<p>Hivemind is currently not being updated. Operations will resume in mid-January.</p>
<p>The sample data below is from 4:40 PM on 11/18/2015.</p>
<div class="row box warning" v-if="offline && dataLoaded">
<p>Hivemind is currently not being updated. Operations will resume in August 2017.</p>
<p>The data below is from <b>{{ lastUpdate | formatTime }}</b>.</p>
</div>
<div class="row box" v-else>
<p>This site displays usage stats for the Berkeley EECS instructional computers.</p>
Expand Down
5 changes: 4 additions & 1 deletion js/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var DATA_URL = 'https://hivemind-data.firebaseapp.com/latest.json';

var OFFLINE = false;
var OFFLINE = true;

var RATING_TEXTS = ['Low', 'Moderate', 'High', 'Unavailable'];

Expand Down Expand Up @@ -85,6 +85,9 @@ var app = new Vue({
reverse: false
},
filters: {
formatTime: function(time) {
return moment.unix(time).format('h:mm a, MMMM Do, YYYY');
},
timeSince: function(time) {
return moment.unix(time).fromNow();
},
Expand Down

0 comments on commit 7e26d96

Please sign in to comment.