Moment.js gives non-refundable answers in the format
I have two instant objects:
> calEvent.start
Moment {_isAMomentObject: true, _i: "2015-06-11T11:00:00", _f: "YYYY-MM-DDTHH:mm:ss", _isUTC: false, _pf: Object…}_ambigTime: false_ambigZone: false_d: Thu Jun 11 2015 11:00:00 GMT+0300 (EEST)_f: "YYYY-MM-DDTHH:mm:ss"_fullCalendar: true_i: "2015-06-11T11:00:00"_isAMomentObject: true_isUTC: false_isValid: true_locale: f_offset: 0_pf: Object__proto__: Moment
> dateTime.startDT
Moment {_isAMomentObject: true, _i: "Th, 11-06-2015 11:00", _f: "dd, DD-MM-YYYY HH:mm", _isUTC: false, _pf: Object…}_d: Thu Jun 11 2015 11:00:00 GMT+0300 (EEST)_f: "dd, DD-MM-YYYY HH:mm"_i: "Th, 11-06-2015 11:00"_isAMomentObject: true_isUTC: false_isValid: true_locale: Object_pf: Object__proto__: Moment
When I format two moment objects with the same string, it gives different answers:
> calEvent.start.format('YYYY-MM-DDTHH:mm')
"2015-06-11A11:00"
^
A? what is that? i was expecting 'T'
> dateTime.startDT.format('YYYY-MM-DDTHH:mm')
"2015-06-11T11:00"
^
This is correct one for me.
I tried to figure out what is different between these objects and why moment.js converts T to A.
+3
source to share
No one has answered this question yet
Check out similar questions: