(value: {
fn: "dateAdd";
value: TaskNotesRuntimeValue;
amount: number;
unit: "day" | "week" | "month";
})
| 3241 | } |
| 3242 | |
| 3243 | function dateAddRuntimeValue(value: { |
| 3244 | fn: "dateAdd"; |
| 3245 | value: TaskNotesRuntimeValue; |
| 3246 | amount: number; |
| 3247 | unit: "day" | "week" | "month"; |
| 3248 | }): string { |
| 3249 | const baseValue = toFilterConditionValue(value.value); |
| 3250 | const base = |
| 3251 | baseValue === "today" |
| 3252 | ? new Date() |
| 3253 | : typeof baseValue === "string" |
| 3254 | ? new Date(baseValue) |
| 3255 | : new Date(); |
| 3256 | if (value.unit === "day") base.setDate(base.getDate() + value.amount); |
| 3257 | if (value.unit === "week") base.setDate(base.getDate() + value.amount * 7); |
| 3258 | if (value.unit === "month") base.setMonth(base.getMonth() + value.amount); |
| 3259 | return base.toISOString().slice(0, 10); |
| 3260 | } |
| 3261 | |
| 3262 | function invertRuntimePredicate( |
| 3263 | predicate: TaskNotesRuntimeNormalizedPredicate |
no test coverage detected