Displaying Day Number at top of page

Hello,

I am attempting to build something similar to a Habit Tracker where there is a checklist of items to complete every day. At midnight their time zone every day the checklist will reset and save that days data to the database.

What I need help with is showing a dynamic text at the top of the checlist page, that displays which Day they are on for their habit. For example; Day 1, Day 2, Day 3, etc…

Thanks for any help!

Hi there, @leavittpreston… when you say “which Day they are on for their habit”, how are you defining the date on which the habit started? It’s hard to help without having that piece of information, but what you are trying to do should be as easy as taking the current date/time, subtracting a date from it, and formatting the result as days. The date you are subtracting might be the user’s creation date or the creation date of a habit or some other date, but again, the general concept should be pretty easy to implement.

Best…
Mike

1 Like

I’d store the date on which the habit started (depends on how you’re defining this as @mikeloc mentioned) and then to display “Day X”, I’d run something like Current date/time - <date_habit_started> : format as days: ceiling to get the value of X.

This topic was automatically closed after 70 days. New replies are no longer allowed.