Obsivus Obsivus - 1 year ago 65
Javascript Question

How can I remove time from date with Moment.js?

formatCalendarDate = function (dateTime) {
return moment.utc(dateTime).format('LLL');
};


It displays: "28 februari 2013 09:24"

But I would like to remove the time at the end. How can I do that?

I'm using Moment.js.

Answer Source

Sorry to jump in so late, but if you're really wanting to remove the time portion of a moment() rather than just formatting it, then the code is:

.startOf('day')

Ref: http://momentjs.com/docs/#/manipulating/start-of/

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download