diff --git a/front/core/components/calendar/index.js b/front/core/components/calendar/index.js index dfc69d837..99b20c92f 100644 --- a/front/core/components/calendar/index.js +++ b/front/core/components/calendar/index.js @@ -133,14 +133,15 @@ export default class Calendar extends Component { date.getFullYear(), date.getMonth(), day); + this.applyOffset(newDate); let event = this.events.find(event => { return event.date >= newDate && event.date <= newDate; }); + console.log(this.events); console.log(newDate); - /* if (curDate >= newDate && curDate <= newDate) color = 'orange'; */ diff --git a/loopback/server/connectors/vn-mysql.js b/loopback/server/connectors/vn-mysql.js index 051d8738f..3df0878c9 100644 --- a/loopback/server/connectors/vn-mysql.js +++ b/loopback/server/connectors/vn-mysql.js @@ -24,23 +24,6 @@ class VnMySQL extends MySQL { } } - fromColumnValue(prop, val) { - if (val == null || !prop || prop.type !== Date) - return MySQL.prototype.fromColumnValue.call(this, prop, val); - - let date = new Date(val); - let locale = new Date(val); - let offset = locale.getTimezoneOffset() * 60000; - date.setTime(date.getTime() + offset); - - return date; - } - - isIsoDate(dateString) { - let isoRegexp = /^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(.[0-9]+)?(Z)?$/g; - return isoRegexp.test(dateString); - } - /** * Promisified version of execute(). * @@ -51,18 +34,6 @@ class VnMySQL extends MySQL { * @return {Promise} The operation promise */ executeP(query, params, options = {}, cb) { - if (params) { - for (let param of params) { - if (param && typeof param.getMonth === 'function' || this.isIsoDate(param)) { - if (this.isIsoDate(param)) param = new Date(param); - let locale = new Date(param); - let offset = locale.getTimezoneOffset() * 60000; - param.setTime(param.getTime() - offset); - console.log(param); - } - } - } - return new Promise((resolve, reject) => { this.execute(query, params, options, (error, response) => { if (cb)