calendar offset
gitea/salix/test This commit looks good Details

This commit is contained in:
Joan Sanchez 2019-02-25 11:32:29 +01:00
parent 5ec352b71a
commit a389ca46a2
1 changed files with 4 additions and 2 deletions

View File

@ -93,7 +93,7 @@ export default class Calendar extends Component {
} }
applyOffset(date) { applyOffset(date) {
// date.setTime(date.getTime() - date.getTimezoneOffset() * 60000); date.setTime(date.getTime() - date.getTimezoneOffset() * 60000);
} }
repaint() { repaint() {
@ -133,11 +133,13 @@ export default class Calendar extends Component {
date.getFullYear(), date.getFullYear(),
date.getMonth(), day); date.getMonth(), day);
this.applyOffset(newDate);
let event = this.events.find(event => { let event = this.events.find(event => {
return event.date >= newDate && event.date <= newDate; return event.date >= newDate && event.date <= newDate;
}); });
console.log(this.events);
console.log(newDate);
/* if (curDate >= newDate && curDate <= newDate) /* if (curDate >= newDate && curDate <= newDate)
color = 'orange'; */ color = 'orange'; */