Save dates from date picker

Hi forum, this is my first post here. I'm a newbie.

I am having a hard time working with dates. Specifically, when it comes to saving and loading dates from TinyDB.

This is the app I am trying to create (or part of it rather, I have tried to keep it to the core issues):

  • A date (OldDate) is displayed in a label and saved to TinyDB (initally, that date is the current date).
  • There is also a date picker to change that date.
  • When it is changed, the date shown in the label is updated and the new date (NewDate) is saved to TinyDB.
  • The app calculates the difference in days between the old and the new date and saves that as a variable (DifferenceInDays).
  • When the date is changed again, that NewDate becomes OldDate.
  • The app calculates the difference in days and updates the DifferenceInDays variable.

you can learn more about working with date and time here


1 Like

Thanks a lot, Taifun, I have had a look around that, and learned a bit. However, I seem to be learning more by just tinkering around with it. I believe now have an app that does just what I described above.

Anyone, feel free to comment on my solution. This may be far from the most efficient way of doing this, or there may be real flaws.

ChangeDateCalculateGapInDays.aia (3.1 KB)