Вопрос

I am using MomentJS to display a date.

moment(startDate).format('lll')

This will display: Jan 29 2014 03:04

But I would like to remove the year which is "2014" how can I do that?

Here is the link to the momentjs

MomentJS

Это было полезно?

Решение

I haven't used that library before, but try this:

moment(StartDate, "MMM DD HH:mm");

At least this would work in .NET.

Другие советы

What you want is:

moment(startdate).format('MMM DD h:mm A');

See a javascript example:

http://jsfiddle.net/remus/rLjQx/

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top