-
Notifications
You must be signed in to change notification settings - Fork 11
Submit Assignment #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
CHARITH GAYASHAN (charithgaya)
wants to merge
12
commits into
codezelaca:main
Choose a base branch
from
charithgaya:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
0c6d6bd
Fix Typo in handleAddCheck
charithgaya 2c3f38c
Fixed Validation Condition
charithgaya 34e52e2
change to data-remove-id and removeId in handleTableClick func.
charithgaya 723f47c
Fixed search issue in status filter
charithgaya 5de4790
Changed json file name correctly
charithgaya 2074f78
Property changed to check.title
charithgaya da74898
Changed name to Fixed instead of Complete
charithgaya 8a7c5b4
Fixed count items due within 7 days
charithgaya aea78eb
Fixed LocalStorage keys mismatch
charithgaya 90a8d99
Fixed status class break for In progress & Due soon calculation bug
charithgaya ae59a92
Modified - Date calculations affected by timezones
charithgaya 21e699d
Fixed my mistake in the code
charithgaya File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| "Title","Category","Priority","Status","Owner","Due Date" | ||
| "Contact form tested","Frontend","Critical","Pending","Naveen","2026-05-04" | ||
| "Homepage meta title added","SEO","High","Fixed","Amani","2026-05-02" | ||
| "Mobile navigation checked","QA","High","In Progress","Dilan","2026-05-03" | ||
| "SSL certificate verified","Security","Critical","Blocked","Mira","2026-05-01" | ||
| "Image compression pass complete","Performance","Medium","Pending","Raveen","2026-05-05" | ||
| "Privacy policy linked in footer","Content","Low","Fixed","Ishara","2026-05-06" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Timezone parsing can shift
dueDateby one day in negative UTC offsets.new Date("YYYY-MM-DD")parses the string as UTC midnight per the ECMAScript spec, thensetHours(0,0,0,0)snaps it to local midnight of whatever local date that UTC instant falls in. For users west of UTC (e.g.Pacific/Honolulu, UTC−10),new Date("2026-05-04")becomes2026-05-03 14:00locally, andsetHours(0,0,0,0)collapses it to2026-05-03— a day earlier than intended.daysUntil(andformatDate) will then be off by one.Parsing the components explicitly avoids the UTC interpretation:
🛠️ Suggested fix
function daysUntil(dateValue) { const today = new Date(); today.setHours(0, 0, 0, 0); - const target = new Date(dateValue); - target.setHours(0, 0, 0, 0); - + const [y, m, d] = String(dateValue).split("-").map(Number); + const target = new Date(y, m - 1, d); + const difference = target.getTime() - today.getTime(); return Math.ceil(difference / 86400000); }Consider the same treatment inside
formatDate.Also note: across DST transitions the millisecond delta is 23h or 25h, so
Math.ceilcan round up an extra day. UsingMath.roundis more forgiving here since both endpoints are already snapped to midnight.📝 Committable suggestion
🤖 Prompt for AI Agents