Skip to content

Latest commit

 

History

History
27 lines (15 loc) · 1.64 KB

README.md

File metadata and controls

27 lines (15 loc) · 1.64 KB

logseq-plugin-timedifference

logseq软件中计算两个时间戳间隔时间的自用插件

感谢这个伟大的时代,没有任何的前端的开发经验,竟然仅仅凭借自然语言不断地与GPT交流,就了解了TypeScript, yarn 以及调用Logseq的API实现自己想要的一个功能。

该插件的icon也是通过Dall-E 实现, 相应prompt为:

Design a concise and visually appealing icon that represents the functionality of calculating the time difference between two timestamps. The icon should incorporate symbols associated with time, such as clocks, hourglasses, or stopwatches, combined with elements that suggest calculation or difference, such as mathematical symbols (plus, minus, equals) or abstract representations of subtraction (like arrows or gaps). Aim for a design that is easily recognizable, uses simple shapes, and conveys the idea of time calculation at a glance. The style should be modern and minimalistic, suitable for use in a digital interface or as an app icon

By the way, prompt也是GPT写的。

愿世界和平!

效果见下:

Logseq自动计算时间戳差插件


以下内容来自QQ群的开发建议, 已实现

  • 当这个块没有时间的时候, 使用此功能, 插入当前时间; 当这个块有一个时间的时候, 再次使用此功能, 插入当前时间并计算时间间接并插入
  • 忽略HH:MM之间冒号前后可能存在的空格,冒号也可能是全角或者半全角的冒号

debug

  • 加入了跨越午夜时间的处理逻辑, 例如23:00 - 00:00 应该计为1h0mins, 当 23:00 - 00:07 应该计算为 1h 7mins