Skip to main content

CurateClick

github.com favicon

timediff

timediff 是一个 Rust 工具库,用于打印可阅读的相对时间段,支持 i18n。它是 Day.js 的 Rust 实现,弥补了 Rust 生态中类似工具的缺失。

Check out timediff on CurateClick

• Copy the embed code to showcase this product on your website

• Share on X to spread the word about this amazing tool

  • 项目地址:https://github.com/lryong/timediff- 语言:Rust- 项目描述:前端同学基本都知道 Moment.jsDay.js,其中 Day.js 是 Moment.js 替代工具,被广泛应用在前端项目中。 timediff 是 Day.js 支持 i18n 的一个 Rust 实现,用于打印不同语言的时间段表达,易于用户理解, 配合 humantime 基本可以完成 Day.js 的所有功能。 timediff 时间段的计算也遵循 Day.js 的规则,它很好地弥补了这个场景下的工具缺失。- 代码使用样例: rust use timediff::*; use timediff::TimeDiffError as Error; assert_eq!( TimeDiff::to_diff(String::from("-10s")) .locale(String::from("zh-CN")) .unwrap() .parse(), Ok(String::from("几秒前")) );

Latest Weekly Picks

promptbuilder.cc favicon
Weekly Pick

Generate, optimize, test, and manage AI prompts in one place. Turn an idea into a ready-to-use prompt in seconds.

Prompt Builder
freqz.net favicon
Weekly Pick

Your Personal K-Style Vibe Photo Studio

Freqz
webleadr.com favicon
Weekly Pick

Find and contact web design leads and businesses without websites, like local dentists, effortlessly from any location in just a few clicks.

Webleadr

the art of having something to say

pretty-scale.com favicon
Weekly Pick

How Pretty Are You? Let AI Decide.

Pretty Scale
c2story.com favicon
Weekly Pick

Create Illustrated Stories with AI

C2story

Impromptu Speech Topics & Timer

Seedance 2.0: Multimodal AI video creator. Precisely direct characters and cameras to create production-ready, multi-shot cinematic stories in one click.