From a9e416184058c23f3134caacf0fbe790df7a0280 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Fri, 1 Mar 2024 09:35:55 +0800 Subject: [PATCH] :art: Support database date field relative to today's filtering https://github.com/siyuan-note/siyuan/issues/10451 --- kernel/av/filter.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/kernel/av/filter.go b/kernel/av/filter.go index e3e6d540e..25040a8bd 100644 --- a/kernel/av/filter.go +++ b/kernel/av/filter.go @@ -42,10 +42,16 @@ const ( RelativeDateUnitYear ) +const ( + RelativeDateDirectionBefore = -1 + RelativeDateDirectionThis = 0 + RelativeDateDirectionAfter = 1 +) + type RelativeDate struct { Count int // 数量 - Unit RelativeDateUnit // 单位:天、周、月、年 - Direction int // 方向:前、现在、后 + Unit RelativeDateUnit // 单位:0 天、1 周、2 月、3 年 + Direction int // 方向:-1 前、0 这、1 后 } type FilterOperator string