Commit bb27ef6
committed
fix(server): make startOfToday IST-aware
The client picks 'today' in IST local time but the server's
startOfToday() returned UTC midnight. For an IST user adding an
expense between 00:00 and 05:30 IST, the expense got stored on UTC
day X, and any later /expenses/today query (which used UTC again)
hit UTC day X+1 — empty. Meanwhile /expenses/by-date?date=<IST-today>
worked because the client sends the IST calendar date.
Shift now() by +5:30 before reading UTC components so 'today' on the
server matches what the IST client sees.1 parent ee6906e commit bb27ef6
1 file changed
Lines changed: 7 additions & 3 deletions
File tree
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
2 | 6 | | |
3 | | - | |
4 | | - | |
| 7 | + | |
| 8 | + | |
5 | 9 | | |
6 | 10 | | |
7 | 11 | | |
| |||
0 commit comments