Skip to content

fix(logs): allow year to be set as well#5206

Merged
khaliqgant merged 1 commit intomasterfrom
change-year-in-logs
Jan 8, 2026
Merged

fix(logs): allow year to be set as well#5206
khaliqgant merged 1 commit intomasterfrom
change-year-in-logs

Conversation

@khaliqgant
Copy link
Member

@khaliqgant khaliqgant commented Jan 7, 2026


Allow Custom Log Periods to Include Year

The PR updates the custom period parsing flow so users can specify four-digit years when entering log date ranges. It tightens the validation regex in parsePeriod and aligns the UI-supplied format string to include the year component.

Key Changes

• Updated parsePeriod regex in packages/webapp/src/utils/dates.ts to require a four-digit year in both range endpoints
• Adjusted dateTimeFormat in packages/webapp/src/components/PeriodSelector.tsx to LLL dd, yyyy, HH:mm:ss so formatted examples and parsed input include the year

Affected Areas

• packages/webapp/src/utils/dates.ts
• packages/webapp/src/components/PeriodSelector.tsx


This summary was automatically generated by @propel-code-bot

@my-senior-dev-pr-review
Copy link

🤖 My Senior Dev — Analysis Complete

👤 For @khaliqgant

📁 Expert in docs (214 edits) • ⚡ 15th PR this month

View your contributor analytics →


📊 2 files reviewed • 1 need attention

⚠️ Needs Attention:

  • packages/webapp/src/components/PeriodSelector.tsx — The change entails a significant update in date format which may affect display consistency, and potential issues if not adequately tested.

🚀 Open Interactive Review →

The full interface unlocks features not available in GitHub:

  • 💬 AI Chat — Ask questions on any file, get context-aware answers
  • 🔍 Smart Hovers — See symbol definitions and usage without leaving the diff
  • 📚 Code Archeology — Understand how files evolved over time (/archeology)
  • 🎯 Learning Insights — See how this PR compares to similar changes

💬 Chat here: @my-senior-dev explain this change — or try @chaos-monkey @security-auditor @optimizer @skeptic @junior-dev

📖 View all 12 personas & slash commands

You can interact with me by mentioning @my-senior-dev in any comment:

In PR comments or on any line of code:

  • Ask questions about the code or PR
  • Request explanations of specific changes
  • Get suggestions for improvements

Slash commands:

  • /help — Show all available commands
  • /archeology — See the history and evolution of changed files
  • /profile — Performance analysis and suggestions
  • /expertise — Find who knows this code best
  • /personas — List all available AI personas

AI Personas (mention to get their perspective):

Persona Focus
@chaos-monkey 🐵 Edge cases & failure scenarios
@skeptic 🤨 Challenge assumptions
@optimizer Performance & efficiency
@security-auditor 🔒 Security vulnerabilities
@accessibility-advocate Inclusive design
@junior-dev 🌱 Simple explanations
@tech-debt-collector 💳 Code quality & shortcuts
@ux-champion 🎨 User experience
@devops-engineer 🚀 Deployment & scaling
@documentation-nazi 📚 Documentation gaps
@legacy-whisperer 🏛️ Working with existing code
@test-driven-purist Testing & TDD

For the best experience, view this PR on myseniordev.com — includes AI chat, file annotations, and interactive reviews.

Copy link
Contributor

@kaposke kaposke left a comment

Choose a reason for hiding this comment

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

Works well. I wonder if we can improve this to make it optional in the future, like datadog (no year = current year, but you have to specify the same format for from and to).

No hard requirement for now though

@khaliqgant khaliqgant added this pull request to the merge queue Jan 8, 2026
Merged via the queue into master with commit cbaf451 Jan 8, 2026
24 checks passed
@khaliqgant khaliqgant deleted the change-year-in-logs branch January 8, 2026 08:24
hassan254-prog pushed a commit that referenced this pull request Jan 12, 2026
<!-- Describe the problem and your solution --> 

<!-- Issue ticket number and link (if applicable) -->

<!-- Testing instructions (skip if just adding/editing providers) -->

<!-- Summary by @propel-code-bot -->

---

**Allow Custom Log Periods to Include Year**

The PR updates the custom period parsing flow so users can specify
four-digit years when entering log date ranges. It tightens the
validation regex in `parsePeriod` and aligns the UI-supplied format
string to include the year component.

<details>
<summary><strong>Key Changes</strong></summary>

• Updated `parsePeriod` regex in `packages/webapp/src/utils/dates.ts` to
require a four-digit year in both range endpoints
• Adjusted `dateTimeFormat` in
`packages/webapp/src/components/PeriodSelector.tsx` to `LLL dd, yyyy,
HH:mm:ss` so formatted examples and parsed input include the year

</details>

<details>
<summary><strong>Affected Areas</strong></summary>

• packages/webapp/src/utils/dates.ts
• packages/webapp/src/components/PeriodSelector.tsx

</details>

---
*This summary was automatically generated by @propel-code-bot*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants