Files
wekan/models/lib/cardMovementRange.js
T
Lauri Ojansivu c17305c2e8 Filter cards by recorded historical movement dates
Match any recorded list, swimlane or incoming board move within inclusive local-day bounds, regardless of later moves. Reuse the authorized reactive ID publication for text and history, preserve lazy-loading coverage and validate history joins and live UI behavior.

Thanks to neooleg and xet7 !
2026-09-28 18:19:22 +03:00

9 lines
580 B
JavaScript

// Wire dates are epoch milliseconds, preserving the browser's local-day bounds.
export function cardMovementRange(start, end) {
const valid = value => value === null || (Number.isSafeInteger(value) && Math.abs(value) <= 8640000000000000);
if (!valid(start) || !valid(end) || (start === null && end === null) ||
(start !== null && end !== null && start >= end)) return null;
return { $type: 9, ...(start === null ? {} : { $gte: new Date(start) }), ...(end === null ? {} : { $lt: new Date(end) }) };
}
export const CARD_MOVEMENT_EVENTS = ['moveCard', 'moveCardBoard'];