v0.11.23 filter schedule list bug fix
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "jama-frontend",
|
||||
"version": "0.11.22",
|
||||
"version": "0.11.23",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -856,6 +856,9 @@ function ScheduleView({ events, selectedDate, onSelect, filterKeyword='', filter
|
||||
const today=new Date(); today.setHours(0,0,0,0);
|
||||
const terms=parseKeywords(filterKeyword);
|
||||
const hasFilters = terms.length > 0 || !!filterTypeId || filterAvailability;
|
||||
// Only keyword/availability filters should shift the date window to today-onwards.
|
||||
// Type filter is for browsing within the current time window, not jumping to future-only.
|
||||
const hasDateShiftingFilters = terms.length > 0 || filterAvailability;
|
||||
// Expand recurring events over a wide range (2 years forward)
|
||||
const farFuture = new Date(today); farFuture.setFullYear(farFuture.getFullYear()+2);
|
||||
const expandedEvents = expandEvents(events, new Date(y,m,1), farFuture);
|
||||
@@ -863,14 +866,15 @@ function ScheduleView({ events, selectedDate, onSelect, filterKeyword='', filter
|
||||
const isCurrentMonth = y === today.getFullYear() && m === today.getMonth();
|
||||
// from/to logic:
|
||||
// - filterFromDate set (mini-calendar click): show from that date to end of its month
|
||||
// - hasFilters (keyword/type/avail): show from today to far future
|
||||
// - month nav (no filterFromDate, no filters): show full month, including past events in grey
|
||||
// - keyword/availability filters: show from today to far future (find upcoming matches)
|
||||
// - type filter only: use normal month window (same events, just filtered by type)
|
||||
// - no filters: show full month, including past events in grey
|
||||
let from, to;
|
||||
if (filterFromDate) {
|
||||
const fd = new Date(filterFromDate); fd.setHours(0,0,0,0);
|
||||
from = fd;
|
||||
to = new Date(fd.getFullYear(), fd.getMonth()+1, 0, 23, 59, 59);
|
||||
} else if (hasFilters) {
|
||||
} else if (hasDateShiftingFilters) {
|
||||
from = today;
|
||||
to = new Date(9999,11,31);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user