diff --git a/packages/rpl-crawler/src/flight-decoder/flight-decoder-utils.ts b/packages/rpl-crawler/src/flight-decoder/flight-decoder-utils.ts index b21b72b7..dabdb458 100644 --- a/packages/rpl-crawler/src/flight-decoder/flight-decoder-utils.ts +++ b/packages/rpl-crawler/src/flight-decoder/flight-decoder-utils.ts @@ -14,7 +14,7 @@ export const resolveFlightDate = (date: string): Date => { const month = parseInt(date.substr(2, 2)) - 1 const year = parseInt(date.substr(4, 2)) + 2000 - return new Date(year, month, day) + return new Date(Date.UTC(year, month, day)) } export const resolveWeekDays = (weekdays: string): Weekdays[] => { diff --git a/packages/rpl-crawler/tests/flight-decoder/flight-decoder.test.ts b/packages/rpl-crawler/tests/flight-decoder/flight-decoder.test.ts index 98891ae2..5582fcd9 100644 --- a/packages/rpl-crawler/tests/flight-decoder/flight-decoder.test.ts +++ b/packages/rpl-crawler/tests/flight-decoder/flight-decoder.test.ts @@ -13,8 +13,8 @@ describe('flight-decoder', () => { @` const flight = flightDecoder(line) - expect(flight.beginDate).toEqual(new Date('2020-07-23')) - expect(flight.endDate).toEqual(new Date('2020-10-01')) + expect(flight.beginDate).toEqual(new Date(Date.UTC(2020, 6, 23))); + expect(flight.endDate).toEqual(new Date(Date.UTC(2020, 9, 1))); }) test('Given flight with IFR Flight Rule', () => {