更新年月日日期格式 (#225)

This commit is contained in:
Taivas Jumala 2023-04-25 14:46:49 +08:00 committed by GitHub
parent 5fa65c613d
commit f3a9c39ca7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,7 +21,7 @@ function date_translator(input, seg, env)
local cand = Candidate("date", seg.start, seg._end, os.date("%Y.%m.%d"), "")
cand.quality = 100
yield(cand)
local cand = Candidate("date", seg.start, seg._end, os.date("%Y 年 %m 月 %d 日"), "")
local cand = Candidate("date", seg.start, seg._end, os.date("%Y 年 ")..tostring(tonumber(os.date("%m")))..os.date(" 月 %d 日"), "")
cand.quality = 100
yield(cand)
end