Commit a820abfc authored by dagal's avatar dagal
Browse files

Extract secondsFromMinDate

parent 841c0ccd
......@@ -29,15 +29,6 @@
isLoading: true,
}
},
methods: {
secondsFromMinDate(d) {
if (this.$root.minDate) {
return (d.getTime() - this.$root.minDate.getTime())/1000;
} else {
return -1;
}
}
},
asyncComputed: {
stats: {
get () {
......@@ -55,8 +46,8 @@
}
return getty.getStopStats(this.stop.id,
this.secondsFromMinDate(startDate),
this.secondsFromMinDate(endDate)).then(x => {
this.$root.secondsFromMinDate(startDate),
this.$root.secondsFromMinDate(endDate)).then(x => {
this.isLoading = false;
return x;
});
......
......@@ -30,15 +30,6 @@
isLoading: true,
}
},
methods: {
secondsFromMinDate(d) {
if (this.$root.minDate) {
return (d.getTime() - this.$root.minDate.getTime())/1000;
} else {
return -1;
}
}
},
asyncComputed: {
stats: {
get () {
......@@ -57,8 +48,8 @@
return getty.getXY(this.stopX.id,
this.stopY.id,
this.secondsFromMinDate(startDate),
this.secondsFromMinDate(endDate)).then(x => {
this.$root.secondsFromMinDate(startDate),
this.$root.secondsFromMinDate(endDate)).then(x => {
this.isLoading = false;
return x;
});
......
......@@ -75,6 +75,13 @@ let app = new Vue({
marker.openPopup();
}
}
},
secondsFromMinDate(d) {
if (this.minDate) {
return (d.getTime() - this.minDate.getTime())/1000;
} else {
return -1;
}
}
}
});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment