Skip to content

Commit

Permalink
feat: timestamp 时间戳快捷输入
Browse files Browse the repository at this point in the history
  • Loading branch information
JacianLiu authored Oct 26, 2024
1 parent f3fe67b commit 2aaeec7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lua/mint_date_time_translator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@
3. 输入 time 可以出现当前的时间
4. 输入 month 可以出现当前的月份
5. 输入 datetime 可以出现当前时间节点
6. 输入 timestamp 可以出现当前时间戳
参考借鉴: https://github.com/KyleBing/rime-wubi86-jidian
Mintimate 修改内容:
1. 适配权重
2. 注解添加
JacianLiu 修改内容:
1. 增加时间戳
--]]

Expand Down Expand Up @@ -108,6 +111,10 @@ function mint_date_time_translator(input, seg)
yield(make_hight_quality_candidate("month", seg.start, seg._end, os.date("%B"), "全称"))
yield(make_hight_quality_candidate("month", seg.start, seg._end, os.date("%b"), "缩写"))
end

if (input == "timestamp") then
yield(make_hight_quality_candidate("timestamp", seg.start, seg._end, string.format('%d', os.time()), ""))
end
end

return mint_date_time_translator

0 comments on commit 2aaeec7

Please sign in to comment.