Tip
You can use the awesome moment.js in your ember app using the ember-moment addon. First thing, install it:
1 |
ember install ember-moment |
There are several template helpers included, here are a few examples and their outputs
1 2 3 4 5 6 7 |
{{moment-format date}} 2016-07-04T00:00:00-04:00 {{moment-from-now date hideSuffix=true}} 4 days {{moment-to-now date hidePrefix=true}} 4 days {{moment-calendar date}} |
Last Monday at 12:00 AM
You can also use this in your javascript with an import statement:
1 |
import moment from 'moment'; |
Credits & Links
ember-moment (thank the author)
moment.js
Some Love ❤❤❤
If you are enjoying my daily tips please spread the word with this one-click tweet.
If you do NOT like the tips then please reply to this email and let me know.