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_overviewreturnstodayandyesterdayfor that zone. Use them for "yesterday", "last night" and weekday names. datedefaults to today. A date after today in the record's time zone is refused.
Backfills
- A backfill is a log with
dateset 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
timeas HH:MM only when the user says when they ate. Most entries have no time. dateandtimeare local to the record'stimeZone, which defaults to the profile's. When the user travels, pass the localtimeZonefor 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 thecorrectionsguide. - Never log a copy on the new day and leave the original.