mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 17:10:12 +01:00
Add a template function about date 补充一个日期相关的模板函数 (#9815)
* Update time.go 添加一个与日期相关的模板函数,有「星期天」了 * Update template.go 添加一个日期相关的模板函数
This commit is contained in:
parent
7acc6bd02d
commit
3dc72e25da
2 changed files with 10 additions and 0 deletions
|
|
@ -49,6 +49,7 @@ func RenderGoTemplate(templateContent string) (ret string, err error) {
|
|||
tmpl = tmpl.Funcs(template.FuncMap{
|
||||
"Weekday": util.Weekday,
|
||||
"WeekdayCN": util.WeekdayCN,
|
||||
"WeekdayCN2": util.WeekdayCN2,
|
||||
"ISOWeek": util.ISOWeek,
|
||||
})
|
||||
tpl, err := tmpl.Parse(templateContent)
|
||||
|
|
@ -249,6 +250,7 @@ func renderTemplate(p, id string, preview bool) (string, error) {
|
|||
}
|
||||
funcMap["Weekday"] = util.Weekday
|
||||
funcMap["WeekdayCN"] = util.WeekdayCN
|
||||
funcMap["WeekdayCN2"] = util.WeekdayCN2
|
||||
funcMap["ISOWeek"] = util.ISOWeek
|
||||
|
||||
goTpl := template.New("").Delims(".action{", "}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue