Moment js in EEx

I am an ex meteor js developer and so get used to use the javascript like moment js in the server and i am trying phoenix right now so i was kinda confuse how it interact with javascript since i saw it got npm. can we use moment along side the template like <%= moment(date) %> or there other way that phoenix have it own library for it ?

Meteor runs JS on the server side, so you can use it there. Phoenix doesn’t.

Either make the moment calls client side, or use an equivalent. moment provides quite a lot of functionality, but I’d guess Timex is probably the closest thats popularly used.

2 Likes

I see thank you