浏览代码

:bug: Database rollup calculation range anomaly https://github.com/siyuan-note/siyuan/issues/10913

Daniel 1 年之前
父节点
当前提交
49e62ebff5
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      kernel/av/value.go

+ 3 - 1
kernel/av/value.go

@@ -501,9 +501,9 @@ func NewFormattedValueDate(content, content2 int64, format DateFormat, isNotTime
 		formatted = contentTime.Format("2006-01-02 15:04")
 	}
 
+	content2Time := time.UnixMilli(content2)
 	if hasEndDate {
 		var formattedContent2 string
-		content2Time := time.UnixMilli(content2)
 		if isNotTime {
 			formattedContent2 = content2Time.Format("2006-01-02")
 		} else {
@@ -523,6 +523,8 @@ func NewFormattedValueDate(content, content2 int64, format DateFormat, isNotTime
 	ret = &ValueDate{
 		Content:          content,
 		Content2:         content2,
+		IsNotEmpty:       true,
+		IsNotEmpty2:      !content2Time.IsZero(),
 		HasEndDate:       hasEndDate,
 		IsNotTime:        true,
 		FormattedContent: formatted,