Show long date format without year in momentjs

I use this to format the date for now:

var format = moment().localeData(locale).longDateFormat("L"); return moment(dateObj).format(format); 

Where the locale can be any market, for example. en-US, fr-FR, en-GB, etc.

However, the L date format is MM/DD/YYYY (it is of course changing to the market), and I just want MM/DD . I did not find any format that provides such a string. Does anyone know how I can achieve the desired functionality?

+5
source share
1 answer

It may be a little stupid than what you are looking for, but ....

 var format = moment().localeData('en').longDateFormat("L"); moment().format(format).substr(0,moment().format(format).length-5); 
-1
source

All Articles