mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 Improve av https://github.com/siyuan-note/siyuan/issues/15498
This commit is contained in:
parent
c1682895ef
commit
96346a94ad
3 changed files with 10 additions and 5 deletions
|
|
@ -137,9 +137,7 @@ func renderAttributeViewGroups(viewable av.Viewable, attrView *av.AttributeView,
|
|||
}
|
||||
}
|
||||
|
||||
todayStart := time.Now()
|
||||
todayStart = time.Date(todayStart.Year(), todayStart.Month(), todayStart.Day(), 0, 0, 0, 0, time.Local)
|
||||
sortGroupViews(todayStart, view)
|
||||
sortGroupViews(view)
|
||||
|
||||
var groups []av.Viewable
|
||||
for _, groupView := range view.Groups {
|
||||
|
|
@ -195,7 +193,7 @@ func hideEmptyGroupViews(view *av.View, viewable av.Viewable) {
|
|||
}
|
||||
}
|
||||
|
||||
func sortGroupViews(todayStart time.Time, view *av.View) {
|
||||
func sortGroupViews(view *av.View) {
|
||||
if av.GroupOrderMan == view.Group.Order {
|
||||
sort.Slice(view.Groups, func(i, j int) bool { return view.Groups[i].GroupSort < view.Groups[j].GroupSort })
|
||||
return
|
||||
|
|
@ -259,6 +257,7 @@ func sortGroupViews(todayStart time.Time, view *av.View) {
|
|||
}
|
||||
|
||||
startIdx := -1
|
||||
todayStart := util.GetTodayStart()
|
||||
thisMonth := todayStart.Format("2006-01")
|
||||
for i, monthGroup := range relativeDateGroups {
|
||||
if monthGroup.GetGroupValue() < thisMonth {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue