Skip to content
Snippets Groups Projects
Verified Commit c4a8e64d authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Fix setting of first time in Calendar

parent 4e66a4f8
No related branches found
No related tags found
1 merge request!1304Refactor calendar overview in more different components
...@@ -197,6 +197,11 @@ export default { ...@@ -197,6 +197,11 @@ export default {
}, },
}, },
methods: { methods: {
dateWithoutTime(d) {
d = new Date(d);
d.setHours(0, 0, 0, 0);
return d;
},
prev() { prev() {
this.$refs.calendar.prev(); this.$refs.calendar.prev();
}, },
...@@ -255,11 +260,14 @@ export default { ...@@ -255,11 +260,14 @@ export default {
}, },
updateMinTime() { updateMinTime() {
// Set the minimum time of the calendar // Set the minimum time of the calendar
const visibileEvents = this.events.filter( const visibileEvents = this.events.filter((event) => {
(event) => return (
event.end >= new Date(this.range.start.date) && this.dateWithoutTime(event.end) >=
event.start <= new Date(this.range.end.date) this.dateWithoutTime(new Date(this.range.start.date)) &&
); this.dateWithoutTime(event.start) <=
this.dateWithoutTime(new Date(this.range.end.date))
);
});
const minuteTimes = visibileEvents.map((event) => const minuteTimes = visibileEvents.map((event) =>
this.getMinutesAfterMidnight(event.start) this.getMinutesAfterMidnight(event.start)
); );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment