ita-matrix-powertools icon indicating copy to clipboard operation
ita-matrix-powertools copied to clipboard

Improper 12-hour clock usage

Open d5xtgr opened this issue 1 year ago • 1 comments

Air Canada appears to blindly trust the times provided in the B_DATE_* parameters, but expects them to be in 24-hour time, while this tool provides them in 12-hour time. As a result, on the Air Canada review page, a flight that overlaps noon but starts and ends on the same calendar date:

  • is reported to have negative duration
  • is missing any layover that overlaps noon
  • contains incorrect departure time for the leg following such a location
  • lists other PM times as occurring twelve hours earlier, i.e. the corresponding AM time

I compared two itineraries between the same set of cities YYZ-YUL-YHZ, one that completes entirely in the AM and one that provokes the errors above. Here are the overviews on the "Trip Review" page:

compare-overview

Here are the corresponding detail views:

compare-details

I suspect that this would be corrected by changing currentItin.itin[i].seg[j].dep.time to currentItin.itin[i].seg[j].dep.time24 on line 114 of amadeus.js, in parallel with line 71 of the same file. However, I have no idea if there are negative side effects to doing so.

d5xtgr avatar Feb 16 '24 03:02 d5xtgr

Hi there and thanks for the details. I'm happy to approve any reasonable PRs for this!

adamhwang avatar Feb 28 '24 01:02 adamhwang