timrwood/moment — Issue #157: Parsing string with no spaces
Author: bengladwell
Created: 2012-02-03 16:41:51+00:00
State: open

The following node script fails to correctly parse date strings that do not have spaces.

var moment = require('moment');
console.log(moment('20120126', 'YYYYMMDD')); // fails
console.log(moment('2012 01 26', 'YYYY MM DD')); // succeeds
console.log(moment('01042011', 'MMDDYYYY')); // fails
console.log(moement('01 04 2011', 'MM DD YYYY')); // throws exception