Avoid local timezone issues when converting GTFS date strings to/from JS dates by zeroing out the HH:MM:SS portion of the date in getDateFromGTFSString. This forces the date object to be created with respect to the machine's local timezone. Prior to this change, the toGTFSDate test would fail when running on a machine in EDT, since the date object for 20190604 would become 20190603 due to the time offset.
Specific changes:
Rename toGTFSDate and corresponding spec file to gtfsDateUtils
Extract getDateFromGTFSString to an external function in gtfsDateUtils
Avoid local timezone issues when converting GTFS date strings to/from JS dates by zeroing out the HH:MM:SS portion of the date in
getDateFromGTFSString
. This forces the date object to be created with respect to the machine's local timezone. Prior to this change, thetoGTFSDate
test would fail when running on a machine in EDT, since the date object for20190604
would become20190603
due to the time offset.Specific changes:
toGTFSDate
and corresponding spec file togtfsDateUtils
getDateFromGTFSString
to an external function ingtfsDateUtils
getDateFromGTFSString