Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

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

Daniel9b2cc71e6454
diff --git a/kernel/av/value.go b/kernel/av/value.go
index 031e8c13d4..2d9e2a83fb 100644
--- a/kernel/av/value.go
+++ b/kernel/av/value.go
@@ -810,7 +810,7 @@ func (r *ValueRollup) RenderContents(calc *RollupCalc, destKey *Key) {
r.Contents = []*Value{{Type: KeyTypeNumber, Number: NewFormattedValueNumber(maxVal-minVal, destKey.NumberFormat)}}
}
if 0 != earliest && 0 != latest {
- r.Contents = []*Value{{Date: NewFormattedValueDate(earliest, latest, DateFormatDuration, isNotTime, hasEndDate)}}
+ r.Contents = []*Value{{Type: KeyTypeDate, Date: NewFormattedValueDate(earliest, latest, DateFormatDuration, isNotTime, hasEndDate)}}
}
case CalcOperatorEarliest:
earliest := int64(0)
@@ -825,7 +825,7 @@ func (r *ValueRollup) RenderContents(calc *RollupCalc, destKey *Key) {
}
}
if 0 != earliest {
- r.Contents = []*Value{{Date: NewFormattedValueDate(earliest, 0, DateFormatNone, isNotTime, hasEndDate)}}
+ r.Contents = []*Value{{Type: KeyTypeDate, Date: NewFormattedValueDate(earliest, 0, DateFormatNone, isNotTime, hasEndDate)}}
}
case CalcOperatorLatest:
latest := int64(0)
@@ -840,7 +840,7 @@ func (r *ValueRollup) RenderContents(calc *RollupCalc, destKey *Key) {
}
}
if 0 != latest {
- r.Contents = []*Value{{Date: NewFormattedValueDate(latest, 0, DateFormatNone, isNotTime, hasEndDate)}}
+ r.Contents = []*Value{{Type: KeyTypeDate, Date: NewFormattedValueDate(latest, 0, DateFormatNone, isNotTime, hasEndDate)}}
}
case CalcOperatorChecked:
countChecked := 0