-
Notifications
You must be signed in to change notification settings - Fork 56
feat: refactor date picker components and remove deprecated code #3003
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
base: kubecon-2025
Are you sure you want to change the base?
Conversation
- Introduced a new DateTimePicker component to replace the existing SingleDatePicker and DayPickerRangeController. - Updated DeploymentMetrics and CustomLogsModal to utilize the new DateTimePicker for date selection. - Removed unused styles and components related to the old date picker implementation. - Added utility functions for generating date range options for the new date picker. - Cleaned up imports and adjusted type definitions to accommodate the new date handling logic.
|
Some linked issues are invalid. Please update the issue links:\nIssue # in is not found or invalid (HTTP }404).\n |
|
Some linked issues are invalid. Please update the issue links:\nIssue # in is not found or invalid (HTTP }404).\n |
…, GraphModal, and DeploymentMetrics components
| startDate: startStr, | ||
| endDate: 'now', | ||
| }) | ||
| const str = getCalendarValue(startStr, 'now') |
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.
Need to check if now-5m and now - 5m are same?
…ency and readability
|



Description
This pull request refactors the way expiration dates are handled for API tokens, moving from using
momentand custom types to a more standardized approach withdayjsand shared types from the common library. The changes improve type safety, maintainability, and UI consistency for selecting and displaying expiration dates.Expiration date handling and UI improvements:
momentand custom date types withdayjsand standardized types (ExpirationDateSelectOptionType) throughout API token components, includingCreateAPIToken,EditAPIToken, andRegenerateModal. [1] [2] [3] [4] [5] [6] [7]DateTimePickercomponent and improved option handling with typed values, enhancing the UI and code reliability. [1] [2] [3]DATE_TIME_FORMATSfrom the common library, ensuring consistent display of dates. [1] [2] [3] [4] [5]Dependency cleanup:
react-datesand its type definitions frompackage.json, as date handling is now done via shared components and libraries. [1] [2]Fixes https://github.com/devtron-labs/sprint-tasks/issues/2714
Type of change
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
Checklist: