The calendar gives you a bird’s-eye view of a full month at a glance. Each day cell shows the net total of all transactions recorded on that day, color-coded so you can immediately see which days were expensive (red) and which brought in money (green). Clicking any day drills down into that day’s individual transactions in the table below.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/akevalion/life_cost/llms.txt
Use this file to discover all available pages before exploring further.
How the Calendar Works
When the page loads — or when the user navigates to a different month —generateCalendar() in calendar.js builds a standard Sunday-to-Saturday grid for the selected month and calls loadMonthValues() to fetch the daily aggregates from the server.
loadMonthValues() sends a POST /money_transfers request with the current month’s date and the client’s IANA timezone:
addSignColor helper applies the CSS class color-insert (green) to positive totals and color-extract (red) to negative totals, so income days and expense days are visually distinct without any extra configuration.
Month Navigation
The calendar header contains Prev (#prevMonth) and Next (#nextMonth) buttons. Clicking either button shifts currentDate by one month and calls generateCalendar() again, rebuilding the grid and fetching fresh data for the new month.
#monthYear heading using date.toLocaleString('default', { month: 'long', year: 'numeric' }), so they automatically match the browser’s locale.
Clicking a Day
Clicking any numbered day cell selects it and loads all transactions for that date into the transaction table:Click a day cell
The previously selected cell loses its
selected-cell CSS class, and the clicked cell gains it, giving a clear visual highlight.Date resolved in client timezone
A new
Date object is constructed from the current calendar month/year and the clicked day number. The client’s timezone string is read from Intl.DateTimeFormat().resolvedOptions().timeZone.POST /money_transfer_from_date
loadMoneyTransferFrom() sends the selected date (as an ISO string) and the timezone to the server. The server converts the local day boundaries to UTC and queries MoneyTransfer records that fall within that window.Average Statistics
Two aggregate stats are displayed below the#monthYear heading in the .average div:
| Stat | Description |
|---|---|
| Average per day | Total of all transactions in the wallet ever, divided by the number of days since the oldest one |
| Average this month | Total for the displayed month divided by the number of days in that month |
POST /money_transfers endpoint as mean and mean_month and are colored with addSignColor so positive averages appear green and negative averages appear red.
Timezone Handling
All date boundary calculations happen in the client’s local timezone, not UTC. The client reads its timezone using the browser-native API:pytz to pin the day’s 00:00:00–23:59:59 boundaries in that timezone, then converts to UTC before querying the database. For the day-click endpoint (POST /money_transfer_from_date), the boundary calculation works as follows:
Today’s date cell is automatically highlighted with the CSS class
today. When you navigate away from the current month and come back, today’s highlight reappears; the selected-cell highlight persists on whichever day was last clicked.