I need to get the past date using the moment. js ( http://momentjs.com/ ), which I get in a specific format:
moment('31.10.2013', 'dd.mm.yy');
This returns me a strange answer when I see the current date in the option _d:
_a: Array[7]
_d: Wed Nov 06 2013 00:10:00 GMT+0200 (EET)
_f: "dd.mm.yy"
_i: "26.10.2013"
_isUTC: false
_l: undefined
_pf: Object
_strict: undefined
I assume this is a formatting issue:
moment('31.10.2013', 'dd.mm.yy').format('YYYY/MM/DD');
So what is wrong here, can I format the past date?
source
share