Skip to content
Snippets Groups Projects
Commit c5aedd15 authored by permcu's avatar permcu
Browse files

Improve calendar nav for in-between days

Did nothing in this case previously
parent a0cd257f
No related branches found
No related tags found
1 merge request!359Improve calendar nav for in-between days
Pipeline #182016 failed
......@@ -333,11 +333,16 @@ export default {
// Also intersect handler does not always react to scrollIntoView
this.setDate(date);
present.focus("smooth");
} else if (
!this.findPrev(DateTime.fromISO(date)) ||
!this.findNext(DateTime.fromISO(date))
) {
this.resetDate(date);
} else {
const prev = this.findPrev(DateTime.fromISO(date));
const next = this.findNext(DateTime.fromISO(date));
if (prev && next) {
// In between two present days -> goto prev
this.gotoDate(prev.toISODate());
} else {
// Outsite present day range
this.resetDate(date);
}
}
},
gotoPrev() {
......
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