ggneilc / stat-tracker

Health & Fitness Tracker designed to gamify life to increase motivation, written in react native
0 stars 0 forks source link

Current Day & Past Days #8

Closed ggneilc closed 10 months ago

ggneilc commented 11 months ago

Need a way to automatically create user days at midnight each night and move their currentDay to pastDays, and then create a new day for currentDay

ggneilc commented 10 months ago

Known bug: every current day also shows up in past days list, when querying it will always show up last, so you could do len-1 or do currentday.id != pastdays.id to exclude the current day from the query

ggneilc commented 10 months ago

last issue before issue can be closed: how to setup the scheduler to run alongside the app start up

ggneilc commented 10 months ago

scheduler is now implemented as a go routine along side the HTTP server. As before, all days show up under 'past_days', so i guess we can just refer to it as 'all days' to avoid confusion. The only thing this changes: when querying through past days, remember to exclude current day. This is only an issue when dealing with recent meals on the input pages, because in the statistics pages, its honestly not a bad idea to just include 'all days' under calculation.