Skip to content

Commit

Permalink
refactor: fix inconsistencies due to timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
jpedroh committed Dec 26, 2022
1 parent ce68b2d commit 5d7943e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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[] => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down

1 comment on commit 5d7943e

@vercel
Copy link

@vercel vercel bot commented on 5d7943e Dec 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

mach – ./

mach-git-master-jpedroh.vercel.app
mach-five.vercel.app
mach-jpedroh.vercel.app
mach.jpedroh.dev

Please sign in to comment.