From 00a5b66e7a41962e7e867d638c70cb6e251046d7 Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Mon, 4 Sep 2017 20:27:25 +0800 Subject: [PATCH] datetime: move presets --- datetime.md | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/datetime.md b/datetime.md index a2e654087..3c61b79d7 100644 --- a/datetime.md +++ b/datetime.md @@ -80,32 +80,21 @@ Used by Ruby, UNIX `date`, and many more. ### Examples -Examples +Date {:.-setup} | Example | Output | | --- | --- | | `YYYY-MM-DD` | `2014-01-01` | | `dddd, MMMM Do YYYY` | `Friday, May 16th 2014` | -| `hh:mm a` | `12:30 pm` | {: .-shortcuts} -Presets +Time {: .-setup} | Example | Output | | --- | --- | -| `LT` | `8:30 PM` | -| `LTS` | `8:30:25 PM` | -| --- | --- | -| `LL` | `August 2 1985` | -| `ll` | `Aug 2 1985` | -| --- | --- | -| `LLL` | `August 2 1985 08:30 PM` | -| `lll` | `Aug 2 1985 08:30 PM` | -| --- | --- | -| `LLLL` | `Thursday, August 2 1985 08:30 PM` | -| `llll` | `Thu, Aug 2 1985 08:30 PM` | +| `hh:mm a` | `12:30 pm` | {: .-shortcuts} Used by [Moment.js](http://momentjs.com/docs/#/displaying/) and [date-fns/format](https://date-fns.org/v1.28.5/docs/format). Similar to Java [SimpleDateFormat](https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html). @@ -174,3 +163,19 @@ Used by [Moment.js](http://momentjs.com/docs/#/displaying/) and [date-fns/format | `x` | | Millisecond Unix timestamp | {: .-shortcuts} +### Presets + +| Example | Output | +| --- | --- | +| `LT` | `8:30 PM` | +| `LTS` | `8:30:25 PM` | +| --- | --- | +| `LL` | `August 2 1985` | +| `ll` | `Aug 2 1985` | +| --- | --- | +| `LLL` | `August 2 1985 08:30 PM` | +| `lll` | `Aug 2 1985 08:30 PM` | +| --- | --- | +| `LLLL` | `Thursday, August 2 1985 08:30 PM` | +| `llll` | `Thu, Aug 2 1985 08:30 PM` | +{: .-shortcuts}