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 { ...@@ -333,11 +333,16 @@ export default {
// Also intersect handler does not always react to scrollIntoView // Also intersect handler does not always react to scrollIntoView
this.setDate(date); this.setDate(date);
present.focus("smooth"); present.focus("smooth");
} else if ( } else {
!this.findPrev(DateTime.fromISO(date)) || const prev = this.findPrev(DateTime.fromISO(date));
!this.findNext(DateTime.fromISO(date)) const next = this.findNext(DateTime.fromISO(date));
) { if (prev && next) {
this.resetDate(date); // In between two present days -> goto prev
this.gotoDate(prev.toISODate());
} else {
// Outsite present day range
this.resetDate(date);
}
} }
}, },
gotoPrev() { 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