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.
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
const CACHE_VERSION = { 'version': '0.0.397' };
|
const CACHE_VERSION = { 'version': '0.0.399' };
|
||||||
const dataCacheName = 'jubileeData-v1';
|
const dataCacheName = 'jubileeData-v1';
|
||||||
const cacheName = 'jubilee-final-1';
|
const cacheName = 'jubilee-final-1';
|
||||||
const filesToCache = [
|
const filesToCache = [
|
||||||
|
@ -32,10 +32,16 @@ const TrafficModel = Backbone.Model.extend({
|
|||||||
this.getTraffic();
|
this.getTraffic();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const day = new Date().getDay();
|
||||||
console.log('tick', this.attributes);
|
console.log('tick', this.attributes);
|
||||||
console.log('((hour >= 7) && (hour <= 9))', ((hour >= 7) && (hour <= 9)));
|
console.log('((hour >= 7) && (hour <= 9))', ((hour >= 7) && (hour <= 9)));
|
||||||
console.log('((hour >= 17) && (hour <= 19))', ((hour >= 17) && (hour <= 19)));
|
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);
|
console.log('Delay', delay);
|
||||||
this.timerID = setTimeout(
|
this.timerID = setTimeout(
|
||||||
() => this.tick(),
|
() => this.tick(),
|
||||||
@ -59,7 +65,6 @@ const TrafficModel = Backbone.Model.extend({
|
|||||||
|
|
||||||
// 55.872407, -3.549003
|
// 55.872407, -3.549003
|
||||||
|
|
||||||
|
|
||||||
// const latlong = { 'lat':latitude, 'lon':longitude };
|
// const latlong = { 'lat':latitude, 'lon':longitude };
|
||||||
if ((hour >= 7) && (hour <= 9)) {
|
if ((hour >= 7) && (hour <= 9)) {
|
||||||
this.set('dest', 'Work');
|
this.set('dest', 'Work');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user