Add Rider Profit Dashboard (Tailwind, fuel API, localStorage, export) - #1
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b5b280d6a7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| function today() { | ||
| return new Date().toISOString().slice(0, 10); | ||
| } |
There was a problem hiding this comment.
Use local dates instead of UTC defaults
When the user's local date differs from UTC, toISOString() returns the UTC day rather than the rider's current local day, so the default job date, summary reference date, and export filename can be one day off (for example, in Thailand before 07:00 local time, or in US time zones during the evening). Since the dashboard is meant to summarize work by local day/week/month, this can put newly entered jobs into the wrong daily summary unless the user manually corrects the date.
Useful? React with 👍 / 👎.
Motivation
localStoragewhile also showing real-time fuel prices when available.Description
index.htmlcontaining KPI cards, job-entry form, fuel-price cards and a jobs table.script.jsto computeliters,fuelCost, andprofit, persist jobs/settings tolocalStorage, render summaries for day/week/month/all, and provide delete/export actions.fetchFuelPrices()with a proxy fetch toenergy.go.thplus a local cache andfallbackFuelslist to handle API/CORS failures, and made fuel cards selectable to populate the form price.exportExcel()(XLS via HTML table blob) and print-to-PDF support, plus adjusted styling instyle.cssand updatedREADME.mdwith features and run instructions.Testing
node --check script.js, which completed successfully.python3 -m http.server 4173) and retrievedindex.htmlwithcurl -I, receiving HTTP 200 (site serves correctly).403 Forbiddenfrom the npm registry so visual screenshot tooling was not available.Codex Task