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
```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.
### Formatting
```js
m
.format()
.format('dddd')
.format("MMM Do YY") // → "Sep 2nd 07"
.fromNow() // → "31 minutes ago"
.calendar() // → "Last Friday at 9:32PM"
.format('MMM Do YY') // → "Sep 2nd 07"
.fromNow() // → "31 minutes ago"
.calendar() // → "Last Friday at 9:32PM"
```
### Add
@ -56,6 +57,12 @@ See [datetime](./datetime) for more.
## References
* [Datetime cheatsheet](./datetime) _(devhints.io)_
* [Moment website](http://momentjs.com/) _(momentjs.com)_
* [Moment docs](http://momentjs.com/docs/) _(momentjs.com)_
### Alternatives
* [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)_