After looking into the issue, it appears as though the localeCheck function is causing the issue. From what I can tell, it should only apply when there is a time to consider. I've moved the localCheck into the branching logic for addCoreFormats where it is also checking for time.
I wrote a test that takes both issues mentioned into account, where a date of December 1 is showing up as January 12th, as well as the original issue where "Invalid Date" was being returned when creating a date without time using dot notation.
This is an attempt to fix this issue: https://github.com/andrewplummer/Sugar/issues/648
After looking into the issue, it appears as though the
localeCheck
function is causing the issue. From what I can tell, it should only apply when there is a time to consider. I've moved thelocalCheck
into the branching logic foraddCoreFormats
where it is also checking for time.I wrote a test that takes both issues mentioned into account, where a date of December 1 is showing up as January 12th, as well as the original issue where "Invalid Date" was being returned when creating a date without time using dot notation.