Top > Tempo
  • The added line is THIS COLOR.
  • The deleted line is THIS COLOR.
  • Go to Tempo.

[[JavaScript/Date]] > [[Tempo]]

- https://tempo.formkit.com/#introduction

*. [#ta4c0dcd]

- 新たなJavaScript日付操作ライブラリ「Tempo」登場 ー ネイティブなDateと直接連携、小さく、速く、使いやすく
--  https://techfeed.io/entries/65dc09931865972ac3ef20e8

 import { format, parse } from "@formkit/tempo"
 // Dateオブジェクトをフォーマット
 let readable = format(new Date(), "full"); // 「2024年2月26日月曜日」のように表示される
 readable = format(new Date(), {time: "full"}) // 「10時32分00秒 +0900」のように表示される
 readable = format(new Date(), "YYYY-MM-DD") // 「2024-02-26」のように表示される
 // 文字列からDateオブジェクトを復元
 parse(readable, "full"); // Date: 2024-02-26T00:00:00.000Z

Reload   Diff   Front page List of pages Search Recent changes Backup Referer   Help   RSS of recent changes