freecals
All topics

Dates and times

How to put each log on the day the user means.

Today and yesterday

  • Freecals resolves dates in the profile's time zone. get_overview returns today and yesterday for that zone. Use them for "yesterday", "last night" and weekday names.
  • date defaults to today. A date after today in the record's time zone is refused.

Backfills

  • A backfill is a log with date set to the day the user ate, such as "also yesterday i had 100ml of milk".
  • One message can hold logs for several days, such as "last night … today …". Give each log its own date.

Times and time zones

  • Send time as HH:MM only when the user says when they ate. Most entries have no time.
  • date and time are local to the record's timeZone, which defaults to the profile's. When the user travels, pass the local timeZone for the record. When the user moves for good, update the profile.

Moving an entry

  • To move an entry to another day, replace it by id with the new date. Read the corrections guide.
  • Never log a copy on the new day and leave the original.