Saturday, April 23, 2022

Default Date of Flight on iOS or Android

(Updated in mid-June 2023; please see the update below)

When using the mobile apps, the "date" field might often be filled in with a stale date - typically the date that you last flew.

So, for example, imagine that you take a flight today (the 23rd as I write this) and after the flight fill in the details of the flight and tap "Add".  The flight gets added to your account and the "New Flight" screen gets reset, including (a) the same aircraft you just used for the flight you just entered, (b) today's date (the 23rd), and (c) some other carry-forward information as appropriate (such as the aforementioned Hobbs time)  Tomorrow (the 24th) you take another flight.  When you tap on "New Flight" it will still say the 23rd because that's the data that was on that screen when you last left it.

I'm occasionally asked why this is and asked to change it so that it always defaults to "Today".  Unfortunately, there's no perfect solution here: optimizing for one scenario actually makes it worse for others, and I've always come back to the same conclusion that it would be the wrong behavior, for two main reasons:

Mostly - it changes data simply based on navigating away and then back to a screen – that’s generally badness, and there’s nothing anywhere else in this system (or any other system I can think of) that modifies data based on a view/navigate event.  For example, imagine if you were to start looking for an airline flight on a given date, then go to another tab to verify you can get the hotel you want, and then when you navigated back to the airline website tab and it had reset your date of flight or origin or destination.  

Think of “New Flight” simply as a browser tab – it’s completely independent of the other tabs, and it doesn’t update its data simply because of the passage of time.  

But perhaps the bigger reason is that it breaks a lot of very common scenarios.  

For example, if you fly today (the 23rd) and fill in some of the data after the flight, but not all of it.  Then tomorrow (the 24th) you fill in the rest of the data, it would be an error to push the date up to the 24th without you doing something.  Or, suppose you depart at 10pm on the 23rd and land after midnight on the 24th - now the date-of-flight would (incorrectly) be the 24th instead of the 23rd.

In a similar vein, it would break the scenario of entering an older flight unless you could complete it without interruption.  For example, suppose you start entering a flight from last week, but you get interrupted and have to leave the screen for a moment.  You come back and continue entering the flight but - alas - now the date has updated from last week to "today."  Not what you intended at all.

So that's why it doesn't update to "today".  But it is obviously not unusual to start a flight on a day that is after your most recent flight.  

For this reason, the apps implement a few "fail-safes" that try to ensure the date is the current (local) date, when appropriate:
  • Setting a flight start, engine start, or block-out time will all adjust the date field to be consistent.  So, for example, if I last flew on April 21st, then the date-of-flight will probably still say April 21.  But if I press “Tap for now” on block out, it will set it to whatever “Now” is locally (April 23, as I write this)
  • You can press-and-hold the date field to set it to "today".  
  • If you want to clear the form for a new flight, you can always do a “Reset” (tap the action button on the lower toolbar and you’ll see the Reset option), and that sets the date to Today


I've updated the iOS and Android apps to have a new notion of "(Today)" as the date.  Think of it as having no specific date at all, and this "floats" with the clock.  If you submit a flight that has "(Today)" (i.e., no specific date), then at that point, it is assigned whatever the current local date is. 

If you tap on the field while it says "(Today)" it will be set to the current date - and since that is a "fixed" (as in "unmoving") date, it will remain there unless or until you explicitly change it or delete it (i.e., render it unspecified/floating again). 

When you reset a flight or when the form is cleared for the next flight after submitting a previous one, the date is set to "Today".

So, for example, if you fly on Monday and fill out a new flight form that has "(Today)" as the date...:
  • If you tap on "(Today)", it will set to Monday's date (fixed).  If you wait until Wednesday to add the flight to your logbook, it will be entered with Monday's date.
  • If you leave the date as "(Today)" and wait until Wednesday to add the flight to your logbook, the flight will get *Wednesday's* date.
  • If you pick any specific date, that date will not change by itself.  But if you delete the date, it will return to a floating "(Today)" value.
The fail-safes described above for the pre-"(Today)" behavior still all work.

No comments:

Post a Comment