Skip to content

Comments

fix: advanced settings time bug#1759

Merged
vignesh05904 merged 1 commit intomasterfrom
date-bug-fix-advanced-settings-26
Feb 20, 2026
Merged

fix: advanced settings time bug#1759
vignesh05904 merged 1 commit intomasterfrom
date-bug-fix-advanced-settings-26

Conversation

@vignesh05904
Copy link
Contributor

@vignesh05904 vignesh05904 commented Feb 20, 2026

Description

Advanced settings time bug

Clickup

https://app.clickup.com

Summary by CodeRabbit

  • Bug Fixes
    • Improved date handling in data exports by standardizing the time component to midnight UTC, ensuring consistent and accurate date formatting across all exported files.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 20, 2026

Walkthrough

The convertDateToSkipExportFormat function in the date utility module was modified to return dates with midnight UTC time (00:00:00.000Z) instead of 5 PM UTC (17:00:00.000Z), while preserving the date components.

Changes

Cohort / File(s) Summary
Date Formatting Update
src/app/core/util/dateRangeConverter.ts
Modified convertDateToSkipExportFormat to use midnight UTC (00:00:00.000Z) as the time component instead of 17:00:00.000Z

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A whisker-twitch at time's great stroke,
From five o'clock to midnight's cloak,
The dates now dance with zero hour,
A simple shift, a formatting power! 🌙⏰

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description is minimal and lacks detail. While it mentions the bug and includes a ClickUp link, it provides no explanation of what was fixed or why the change was made. Expand the description to explain the bug, its impact, and how this change resolves it. Provide context about the time format change from 17:00:00.000Z to 00:00:00.000Z.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary change: fixing a time-related bug in advanced settings, which matches the code modification in convertDateToSkipExportFormat.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch date-bug-fix-advanced-settings-26

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

🔁 Code Duplication Report - Angular

Format Files analyzed Total lines Total tokens Clones found Duplicated lines Duplicated tokens
typescript 786 58401 534943 348 5758 (9.86%) 54031 (10.10%)
scss 68 3795 20521 7 148 (3.90%) 769 (3.75%)
markup 352 17799 166927 158 2105 (11.83%) 17750 (10.63%)
python 4 727 5680 3 32 (4.40%) 368 (6.48%)
yaml 3 155 905 0 0 (0.00%) 0 (0.00%)
javascript 6 397 3497 0 0 (0.00%) 0 (0.00%)
markdown 2 96 366 0 0 (0.00%) 0 (0.00%)
bash 2 69 804 0 0 (0.00%) 0 (0.00%)
Total: 1223 81439 733643 516 8043 (9.88%) 72918 (9.94%)

📊 No significant change in code duplication.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/app/core/util/dateRangeConverter.ts (1)

15-19: ⚠️ Potential issue | 🟠 Major

Switch to UTC getters for defensive consistency and to prevent date shifts in UTC-negative timezones.

Lines 16–18 use local-time getters (getFullYear(), getMonth(), getDate()), yet the returned string is stamped with the Z UTC indicator. This mismatch causes date shifts when the API provides UTC-formatted strings (e.g., from the backend response parsed at line 194 of skip-export.component.ts). In UTC-negative zones, getDate() will return the previous day's date, creating a silent off-by-one error.

The sibling convertDateRangeToAPIFormat uses UTC getters consistently, confirming the expected pattern.

♻️ Proposed refactor
 export const convertDateToSkipExportFormat = (date: Date): string => {
-  const year = date.getFullYear();
-  const month = String(date.getMonth() + 1).padStart(2, '0');
-  const day = String(date.getDate()).padStart(2, '0');
+  const year = date.getUTCFullYear();
+  const month = String(date.getUTCMonth() + 1).padStart(2, '0');
+  const day = String(date.getUTCDate()).padStart(2, '0');
   return `${year}-${month}-${day}T00:00:00.000Z`;
 };
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/app/core/util/dateRangeConverter.ts` around lines 15 - 19,
convertDateToSkipExportFormat currently uses local-time getters
(getFullYear/getMonth/getDate) but returns a UTC-suffixed string, causing
off-by-one dates in negative UTC zones; change it to use UTC getters
(getUTCFullYear, getUTCMonth, getUTCDate) like the sibling
convertDateRangeToAPIFormat so the produced
`${year}-${month}-${day}T00:00:00.000Z` string is consistent with UTC
input/output handling; keep the zero-padding and final string format unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@src/app/core/util/dateRangeConverter.ts`:
- Around line 15-19: convertDateToSkipExportFormat currently uses local-time
getters (getFullYear/getMonth/getDate) but returns a UTC-suffixed string,
causing off-by-one dates in negative UTC zones; change it to use UTC getters
(getUTCFullYear, getUTCMonth, getUTCDate) like the sibling
convertDateRangeToAPIFormat so the produced
`${year}-${month}-${day}T00:00:00.000Z` string is consistent with UTC
input/output handling; keep the zero-padding and final string format unchanged.

@github-actions github-actions bot added the size/XS Extra Small PR label Feb 20, 2026
@vignesh05904 vignesh05904 merged commit 1417032 into master Feb 20, 2026
11 checks passed
vignesh05904 added a commit that referenced this pull request Feb 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Extra Small PR

Development

Successfully merging this pull request may close these issues.

2 participants