Skip to content

feat: Refactor DatePicker UI to use Button component, #972

Open
arunjaindev wants to merge 7 commits into
mainfrom
feat/observability
Open

feat: Refactor DatePicker UI to use Button component, #972
arunjaindev wants to merge 7 commits into
mainfrom
feat/observability

Conversation

@arunjaindev

Copy link
Copy Markdown
Contributor

add new date utility functions, introduce observability routes, and include new SVG icons.

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Checklist

  • The title of the PR states what changed and the related issues number (used for the release note).
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

…ility functions, introduce observability routes, and include new SVG icons.
Comment on lines +130 to +141
export const getCalendarValue = (startDateStr: string, endDateStr: string): string => {
let str: string = `${startDateStr} - ${endDateStr}`
if (endDateStr === 'now' && startDateStr.includes('now')) {
const range = DayPickerRangeControllerPresets.find((d) => d.endStr === startDateStr)
if (range) {
str = range.text
} else {
str = `${startDateStr} - ${endDateStr}`
}
}
return str
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
export const getCalendarValue = (startDateStr: string, endDateStr: string): string => {
let str: string = `${startDateStr} - ${endDateStr}`
if (endDateStr === 'now' && startDateStr.includes('now')) {
const range = DayPickerRangeControllerPresets.find((d) => d.endStr === startDateStr)
if (range) {
str = range.text
} else {
str = `${startDateStr} - ${endDateStr}`
}
}
return str
}
export const getCalendarValue = (startDateStr: string, endDateStr: string): string => {
if (endDateStr === 'now' && startDateStr.includes('now')) {
const range = DayPickerRangeControllerPresets.find((d) => d.endStr === startDateStr)
if (range) {
return range.text
}
}
return `${startDateStr} - ${endDateStr}`
}

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