}
return (format && input) ?
moment(input + ' +0000', format + ' Z').utc() :
- moment(input && !parseTokenTimezone.exec(input) ? input + '+0000' : input).utc();
+ moment(input && isoRegex.exec(input) && !parseTokenTimezone.exec(input) ? input + '+0000' : input).utc();
};
// creating with unix timestamp (in seconds)
},
"number" : function(test) {
- test.expect(2);
+ test.expect(3);
test.ok(moment(1000).toDate() instanceof Date, "1000");
test.ok((moment(1000).valueOf() === 1000), "testing valueOf");
+ test.ok((moment.utc(1000).valueOf() === 1000), "testing valueOf");
test.done();
},