mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 09:59:47 -05:00
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 !
9 lines
580 B
JavaScript
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'];
|