Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions kernel/api/icon.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ package api

import (
"fmt"
"github.com/siyuan-note/siyuan/kernel/util"
"math"
"net/http"
"regexp"
"strconv"
"strings"
"time"

"github.com/siyuan-note/siyuan/kernel/util"

"github.com/gin-gonic/gin"
"github.com/siyuan-note/siyuan/kernel/model"
)
Expand Down Expand Up @@ -238,8 +239,8 @@ func getDateInfo(dateStr string, lang string, weekdayType string) map[string]int
weekdayStr = date.Format("Mon")
}
}
// Calculate week number
_, weekNum := date.ISOWeek()
// Calculate week number and ISO year
isoYear, weekNum := date.ISOWeek()
weekNumStr := fmt.Sprintf("%dW", weekNum)

switch lang {
Expand All @@ -259,6 +260,7 @@ func getDateInfo(dateStr string, lang string, weekdayType string) map[string]int

return map[string]interface{}{
"year": year,
"isoYear": isoYear,
"month": month,
"day": day,
"date": fmt.Sprintf("%02d-%02d", date.Month(), date.Day()),
Expand Down Expand Up @@ -399,7 +401,7 @@ func generateTypeFiveSVG(color string, lang string, dateInfo map[string]interfac
<text transform="translate(22 146.5)" style="fill: #fff;font-size: 120px; font-family: -apple-system, BlinkMacSystemFont, 'Noto Sans', 'Noto Sans CJK SC', 'Microsoft YaHei'; ">%d</text>
<text x="50%%" y="410.5" style="fill: #66757f;font-size: 200px;text-anchor: middle;font-family: -apple-system, BlinkMacSystemFont, 'Noto Sans', 'Noto Sans CJK SC', 'Microsoft YaHei'; ">%s</text>
</svg>
`, colorScheme.Primary, colorScheme.Secondary, dateInfo["year"], dateInfo["week"])
`, colorScheme.Primary, colorScheme.Secondary, dateInfo["isoYear"], dateInfo["week"])
}

// Type 6: 仅显示星期
Expand Down