function makeDateFromStringAndFormat(config) {
// This array is used to make a Date, either with `new Date` or `Date.UTC`
var tokens = config._f.match(formattingTokens),
- string = config._i,
+ string = '' + config._i,
i, parsedInput;
config._a = [];
},
"unix timestamp" : function (test) {
- test.expect(4);
+ test.expect(5);
var m = moment('1234567890.123', 'X');
test.equals(m.format('X'), '1234567890', 'unix timestamp without milliseconds');
test.equals(m.format('X.SS'), '1234567890.12', 'unix timestamp with centiseconds');
test.equals(m.format('X.SSS'), '1234567890.123', 'unix timestamp with milliseconds');
+ m = moment(1234567890.123, 'X');
+ test.equals(m.format('X'), '1234567890', 'unix timestamp as integer');
+
test.done();
},