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

Obsivus picture Obsivus · Feb 28, 2013 · Viewed 236.8k times · Source
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

Graham Charles picture Graham Charles · Oct 31, 2013

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

.startOf('day')

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