I have been getting this strange effect, it's like sometimes momentjs works, sometimes it doesn't.
This is version 1.7.2, running in node.js.
reg.date = moment('230420050000','DDMMYYYYHHmm' ).toJSON();
TypeError: Object Sat Apr 23 2005 00:00:00 GMT+0200 (CEST) has no method 'toJSON'
Question 1: is this not the proper way to instantiate a momentjs object?
When I dump it to the console, I see it has all the typical moment fields:
{ 
  _d: { 
       Fri, 22 Apr 2005 22:00:00 GMT 
       _a: [ 2005, 3, 23, 0, 0, 0, 0, undefined ] 
  },
  _isUTC: false,
  _a: [ 2005, 3, 23, 0, 0, 0, 0, undefined ],
  _lang: false 
}
Question 2: So why did toJSON() vanish?
				
				Answer 1:
Acorinding to your error
Object Sat Apr 23 2005 00:00:00 GMT+0200 (CEST)
The initialization is correct.
Answer 2:
The toJson method is supported from version 2.0.0: http://momentjs.com/docs/#/displaying/as-json/
According to the docs, it seems that .toJSON() is available with version 2.0.0 of MomentJS and you are using 1.7.2