In my function, I handle different valid date strings to produce a JavaScript Date object.
Most strings work as expected, however, when an ISO formatted date (YYYY/MM/DD) is provided, the user's timezone offset is deducted from the date.
For example:
new Date("9/1/2017") // returns Fri Sep 01 2017 00:00:00 GMT-0400 (Eastern Daylight Time)
but
new Date("2017-09-01") // returns Thu Aug 31 2017 20:00:00 GMT-0400 (Eastern Daylight Time)
I've noticed that appending the time - "T00:00:00" to the ISO date resolves this issue and sets the correct date & time. However, I'm curious as to why JavaScript only subtracts the timezone for ISO dates.