Set it so traffic only works during the week
This commit is contained in:
parent
7b34834179
commit
1744d82898
@ -11,7 +11,7 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
const CACHE_VERSION = { 'version': '0.0.397' };
|
||||
const CACHE_VERSION = { 'version': '0.0.399' };
|
||||
const dataCacheName = 'jubileeData-v1';
|
||||
const cacheName = 'jubilee-final-1';
|
||||
const filesToCache = [
|
||||
|
@ -32,10 +32,16 @@ const TrafficModel = Backbone.Model.extend({
|
||||
this.getTraffic();
|
||||
}
|
||||
|
||||
const day = new Date().getDay();
|
||||
console.log('tick', this.attributes);
|
||||
console.log('((hour >= 7) && (hour <= 9))', ((hour >= 7) && (hour <= 9)));
|
||||
console.log('((hour >= 17) && (hour <= 19))', ((hour >= 17) && (hour <= 19)));
|
||||
const delay = ( ((hour >= 7) && (hour <= 9)) || ((hour >= 17) && (hour <= 19)) ) ? 600000 : toHour();
|
||||
let delay;
|
||||
if (day === 0 || day === 6)
|
||||
delay = toHour();
|
||||
else
|
||||
delay = ( ((hour >= 7) && (hour <= 9)) || ((hour >= 17) && (hour <= 19)) ) ? 600000 : toHour();
|
||||
|
||||
console.log('Delay', delay);
|
||||
this.timerID = setTimeout(
|
||||
() => this.tick(),
|
||||
@ -57,8 +63,7 @@ const TrafficModel = Backbone.Model.extend({
|
||||
if (!this.has('latlong'))
|
||||
return;
|
||||
|
||||
// 55.872407, -3.549003
|
||||
|
||||
// 55.872407, -3.549003
|
||||
|
||||
// const latlong = { 'lat':latitude, 'lon':longitude };
|
||||
if ((hour >= 7) && (hour <= 9)) {
|
||||
|
Loading…
Reference in New Issue
Block a user