gr2m / moment-parseformat

A moment.js plugin to extract the format of a date/time string
http://gr2m.github.io/moment-parseformat
Apache License 2.0
45 stars 30 forks source link

fix for #17 add special format #32

Closed zoepage closed 9 years ago

zoepage commented 9 years ago

closes #17

gr2m commented 9 years ago

Sorry, I wasn't clear about it. Please remove these parts:

+    // check if both numbers are < 12, then it must be something wrong
+    format = format.replace(regexDayYear, ‘’)
...
+    if (format.length < 1) {
+      format = undefined
+    }
...
+  t.equal(moment.parseFormat(’15/15’), undefined, ‘both numbers are > 12 - 15/15 → undefined’)

If we something can't be turned into a format because it doesn't make sense, like 13/13, leave the 13/13 in, don't replace anything. Makes sense?

zoepage commented 9 years ago

Ok. Will do :)

gr2m commented 9 years ago

looks good :+1: can you squash commits into one docs / test / fix commit please? Please give the test / fix commits a descriptive message, as it will appear on the GitHub releases page, something like test: parse Day/Month, Month/year #17, then you can go ahead and merge it