moment: link to You Don't Need Moment

This commit is contained in:
Rico Sta. Cruz 2018-09-15 15:06:15 +08:00
parent f3040aa0ff
commit da30696346
No known key found for this signature in database
GPG Key ID: CAAD38AE2962619A
1 changed files with 14 additions and 7 deletions

View File

@ -9,19 +9,20 @@ tags: [Featurable]
### Parsing ### Parsing
```js ```js
m = moment("2013-03-01", "YYYY-MM-DD") m = moment('2013-03-01', 'YYYY-MM-DD')
``` ```
This parses the given date using the given format. Returns a moment object. This parses the given date using the given format. Returns a moment object.
### Formatting ### Formatting
```js ```js
m m
.format() .format()
.format('dddd') .format('dddd')
.format("MMM Do YY") // → "Sep 2nd 07" .format('MMM Do YY') // → "Sep 2nd 07"
.fromNow() // → "31 minutes ago" .fromNow() // → "31 minutes ago"
.calendar() // → "Last Friday at 9:32PM" .calendar() // → "Last Friday at 9:32PM"
``` ```
### Add ### Add
@ -56,6 +57,12 @@ See [datetime](./datetime) for more.
## References ## References
* [Datetime cheatsheet](./datetime) _(devhints.io)_ ### Alternatives
* [Moment website](http://momentjs.com/) _(momentjs.com)_
* [Moment docs](http://momentjs.com/docs/) _(momentjs.com)_ * [You don't need Moment.js](https://github.com/you-dont-need/You-Dont-Need-Momentjs) _(github.com)_
### Also see
* [Datetime cheatsheet](./datetime) _(devhints.io)_
* [Moment website](http://momentjs.com/) _(momentjs.com)_
* [Moment docs](http://momentjs.com/docs/) _(momentjs.com)_