12 bugs fixed#3
12 bugs fixed#3Shathulan_Kaneshapillai (shathulan) wants to merge 12 commits intocodezelaca:mainfrom
Conversation
…heck correctly in
… either title or category is missing in
…s, and owner in app.js.
…us === selectedStatus instead of incorrectly matching check.priority.
…ogress in app.js. Co-authored-by: Copilot <copilot@github.com>
…app.js. Co-authored-by: Copilot <copilot@github.com>
…pp.js Co-authored-by: Copilot <copilot@github.com>
…-remove-id attribute in app.js. Co-authored-by: Copilot <copilot@github.com>
…ers, and refreshes metrics in app.js. Co-authored-by: Copilot <copilot@github.com>
…pp.js. Co-authored-by: Copilot <copilot@github.com>
…ame in app.js. Co-authored-by: Copilot <copilot@github.com>
📝 WalkthroughWalkthroughThis PR corrects ten functional bugs in a checklist application's core workflow: data persistence, form validation, search filtering, metrics calculation, deletion handling, status changes, demo data loading, and CSV export. All changes are in ChangesChecklist Application Bug Corrections
🎯 4 (Complex) | ⏱️ ~45 minutes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@js/app.js`:
- Around line 243-246: The due-soon count is wrong because daysUntil(dateValue)
currently uses new Date(dateValue) which parses "YYYY-MM-DD" as UTC; update
daysUntil to parse string inputs as local calendar dates by splitting
"YYYY-MM-DD" into year, month, day and constructing new Date(year, month-1, day)
(and handle Date inputs unchanged), then use the same local-date construction
logic in formatDate so both functions agree; update any callers (e.g., the
dueSoon calculation over checks and any formatting paths) to rely on the
corrected daysUntil and formatDate behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
| const dueSoon = checks.filter((check) => { | ||
| const days = daysUntil(check.dueDate); | ||
| return days >= 0 && days <= 7; | ||
| }).length; |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
for tz in America/Los_Angeles America/New_York UTC; do
echo "=== $tz ==="
TZ=$tz node <<'NODE'
const dateValue = "2026-05-09";
const now = new Date("2026-05-09T23:00:00");
const target = new Date(dateValue);
const days = Math.ceil((target.getTime() - now.getTime()) / 86400000);
const display = new Intl.DateTimeFormat("en-US", {
month: "short",
day: "numeric",
year: "numeric",
}).format(target);
console.log({
now: now.toString(),
target: target.toString(),
display,
days,
});
NODE
doneRepository: codezelaca/fs-se-debugging-bugs
Length of output: 690
🏁 Script executed:
# First, check if js/app.js exists and its size
wc -l js/app.jsRepository: codezelaca/fs-se-debugging-bugs
Length of output: 89
🏁 Script executed:
# Read lines around 243-246 to verify the code snippet
sed -n '240,250p' js/app.jsRepository: codezelaca/fs-se-debugging-bugs
Length of output: 473
🏁 Script executed:
# Find daysUntil function to verify implementation
rg -n "function daysUntil|daysUntil\s*\(" js/app.js -A 5Repository: codezelaca/fs-se-debugging-bugs
Length of output: 521
🏁 Script executed:
# Find formatDate function to verify implementation
rg -n "function formatDate|formatDate\s*\(" js/app.js -A 8Repository: codezelaca/fs-se-debugging-bugs
Length of output: 776
Parse dueDate as a local calendar date before computing "due soon".
The daysUntil() function parses YYYY-MM-DD strings with new Date(dateValue), which treats them as UTC. In US browsers this shifts the date to the previous local calendar day. A check due on May 9 renders as May 8 and can fall out of the 0..7 window late in the local day, making the due-soon count incorrect. Parse dates into local dates using new Date(year, month - 1, day) and align formatDate() to use the same helper.
Suggested fix
+function parseLocalDate(dateValue) {
+ if (!dateValue) {
+ return null;
+ }
+
+ const [year, month, day] = dateValue.split("-").map(Number);
+ return new Date(year, month - 1, day);
+}
+
function daysUntil(dateValue) {
- const today = new Date();
- const target = new Date(dateValue);
- const difference = target.getTime() - today.getTime();
- return Math.ceil(difference / 86400000);
+ const target = parseLocalDate(dateValue);
+ if (!target) {
+ return Number.POSITIVE_INFINITY;
+ }
+
+ const today = new Date();
+ const startOfToday = new Date(
+ today.getFullYear(),
+ today.getMonth(),
+ today.getDate(),
+ );
+
+ return Math.round((target.getTime() - startOfToday.getTime()) / 86400000);
}
function formatDate(dateValue) {
if (!dateValue) {
return "No date";
}
return new Intl.DateTimeFormat("en", {
month: "short",
day: "numeric",
year: "numeric",
- }).format(new Date(dateValue));
+ }).format(parseLocalDate(dateValue));
}🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@js/app.js` around lines 243 - 246, The due-soon count is wrong because
daysUntil(dateValue) currently uses new Date(dateValue) which parses
"YYYY-MM-DD" as UTC; update daysUntil to parse string inputs as local calendar
dates by splitting "YYYY-MM-DD" into year, month, day and constructing new
Date(year, month-1, day) (and handle Date inputs unchanged), then use the same
local-date construction logic in formatDate so both functions agree; update any
callers (e.g., the dueSoon calculation over checks and any formatting paths) to
rely on the corrected daysUntil and formatDate behavior.
Show a launch checklist with starter checks.
Fixed.data/launch-checks.json.all fixed
Summary by CodeRabbit