Using time in Meteor

Defining dates and time is always an arse in any language, even more so with Javascript. Thankfully MomentJs helps enormously and using it with Meteor makes dates a doddle.
My tip for sanity is to save all dates as timestamps (better for logical comparison) and then convert them to readable dates on the client using moment... Hasseeeesh!
Written by Darren
Related protips
2 Responses
That's an excellent library, I've never seen that before. Another excellent one is Sugar.js, which has an amazing Date library too: http://sugarjs.com/dates
That sure is purty looking syntax. Will be sure to check it out.
Have a fresh tip? Share with Coderwall community!
JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.
Security insights from Cside