fix: sort upcoming tasks by nearest due date#1180
Open
Ptmishra69 wants to merge 1 commit into
Open
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
📌 Description
This PR fixes a bug in the Dashboard where the "Upcoming Tasks" panel displayed the most recently created tasks rather than the most urgent ones. The logic has been updated to filter tasks by
dueDatepresence and sort them chronologically, ensuring that tasks with the nearest deadlines appear first.🔗 Related Issue
Closes #<insert_issue_number_here>
🛠 Changes Made
upcomingTaskscomputation inDashboard.jsx.dueDate..sort()step to rank tasks in ascending order based on their due date..slice(0, 2)logic to display only the top two most urgent tasks.📸 Screenshots (if applicable)
N/A - This is a logic fix for how data is sorted, rather than a visual UI change.
✅ Checklist
🚀 Notes for Reviewers
The change is isolated to
frontend/src/pages/Dashboard.jsx(lines 88-91). Tested locally with tasks having future, past, and no due dates to confirm the sorting behavior works as expected.