Rebuild frontend.

This commit is contained in:
James Cole
2021-04-19 06:49:58 +02:00
parent f1798a1c97
commit 6e0be9a6a2
29 changed files with 67 additions and 66 deletions

View File

@@ -186,20 +186,20 @@ export default {
},
generateWeekly: function () {
console.log('weekly');
//console.log('weekly');
let today = new Date(this.range.start);
console.log('Today is ' + today);
//console.log('Today is ' + today);
let start = startOfDay(startOfWeek(subDays(today, 7), {weekStartsOn: 1}));
let end = endOfDay(endOfWeek(subDays(today, 7), {weekStartsOn: 1}));
let dateFormat = this.$t('config.week_in_year_fns');
console.log('Date format: "'+dateFormat+'"');
//console.log('Date format: "'+dateFormat+'"');
let title = format(start, dateFormat);
// last week
console.log('Last week');
console.log(start);
console.log(end);
console.log(title);
// console.log('Last week');
// console.log(start);
// console.log(end);
// console.log(title);
this.periods.push(
{
start: start.toDateString(),
@@ -212,10 +212,10 @@ export default {
start = startOfDay(startOfWeek(today, {weekStartsOn: 1}));
end = endOfDay(endOfWeek(today, {weekStartsOn: 1}));
title = format(start, dateFormat);
console.log('This week');
console.log(start);
console.log(end);
console.log(title);
// console.log('This week');
// console.log(start);
// console.log(end);
// console.log(title);
this.periods.push(
{
start: start.toDateString(),
@@ -228,10 +228,10 @@ export default {
start = startOfDay(startOfWeek(addDays(today, 7), {weekStartsOn: 1}));
end = endOfDay(endOfWeek(addDays(today, 7), {weekStartsOn: 1}));
title = format(start, dateFormat);
console.log('Next week');
console.log(start);
console.log(end);
console.log(title);
// console.log('Next week');
// console.log(start);
// console.log(end);
// console.log(title);
this.periods.push(
{
start: start.toDateString(),

View File

@@ -123,13 +123,14 @@ export default {
drawChart: function () {
//console.log('drawChart');
if ('undefined' !== typeof this._chart) {
//console.log('destroy or update!');
// console.log('update!');
this._chart.data = this.dataCollection;
this._chart.update();
this.initialised = true;
}
if ('undefined' === typeof this._chart) {
//console.log('new!');
// console.log('new!');
this._chart = new ChartJs.Chart(this.$refs.canvas.getContext('2d'), {
type: 'line',
data: this.dataCollection,
@@ -140,9 +141,9 @@ export default {
}
},
updateChart: function () {
//console.log('updateChart');
// console.log('updateChart');
if (this.initialised) {
//console.log('MUST Update chart!');
// console.log('MUST Update chart!');
// reset some vars so it wont trigger again:
this.initialised = false;
this.initialiseChart();

View File

@@ -179,9 +179,9 @@ const actions = {
end = endOfDay(end);
break;
}
console.log('Range is ' + viewRange);
console.log('Start is ' + start);
console.log('End is ' + end);
// console.log('Range is ' + viewRange);
// console.log('Start is ' + start);
// console.log('End is ' + end);
context.commit('setStart', start);
context.commit('setEnd', end);
context.commit('setDefaultStart', start);