-
Notifications
You must be signed in to change notification settings - Fork 11.6k
feat: integrate DateTimePickerAndroid for date/time selection #26979
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: main
Are you sure you want to change the base?
feat: integrate DateTimePickerAndroid for date/time selection #26979
Conversation
- Added @react-native-community/datetimepicker dependency for native date/time picker functionality. - Replaced modal-based date/time picker implementation with DateTimePickerAndroid for improved user experience. - Updated RescheduleScreen to utilize the new date/time picker methods, enhancing the selection process and ensuring better styling consistency.
- Introduced a new LimitsTabDatePicker component utilizing DateTimePickerAndroid for improved date selection on Android. - Implemented date parsing and formatting for user-friendly display. - Enhanced user interaction with a pressable element to open the date picker.
- Introduced EditAvailabilityOverrideScreen component to allow users to create and edit availability overrides. - Implemented date and time selection using DateTimePickerAndroid for improved user experience. - Added functionality to handle existing overrides, including editing and deleting options. - Enhanced user interaction with clear alerts for success and error states during save operations.
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.
1 issue found across 5 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="companion/components/screens/RescheduleScreen.android.tsx">
<violation number="1" location="companion/components/screens/RescheduleScreen.android.tsx:114">
P2: 90-day reschedule limit removed: native DateTimePicker has no maximumDate, allowing arbitrary future dates</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| setSelectedDateTime(newDate); | ||
| } | ||
| }, | ||
| minimumDate: new Date(), // Prevent selecting past dates |
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.
P2: 90-day reschedule limit removed: native DateTimePicker has no maximumDate, allowing arbitrary future dates
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At companion/components/screens/RescheduleScreen.android.tsx, line 114:
<comment>90-day reschedule limit removed: native DateTimePicker has no maximumDate, allowing arbitrary future dates</comment>
<file context>
@@ -100,6 +98,40 @@ export const RescheduleScreen = forwardRef<RescheduleScreenHandle, RescheduleScr
+ setSelectedDateTime(newDate);
+ }
+ },
+ minimumDate: new Date(), // Prevent selecting past dates
+ });
+ }, [selectedDateTime]);
</file context>
Fix confidence (alpha): 8/10
| minimumDate: new Date(), // Prevent selecting past dates | |
| minimumDate: new Date(), // Prevent selecting past dates | |
| maximumDate: new Date(Date.now() + 90 * 24 * 60 * 60 * 1000), // Limit to next 90 days |
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.
2 issues found across 1 file (changes from recent commits).
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="companion/components/screens/EditAvailabilityOverrideScreen.android.tsx">
<violation number="1" location="companion/components/screens/EditAvailabilityOverrideScreen.android.tsx:110">
P2: Unavailable override misdetected when API returns times with seconds, blocking save due to failed time validation</violation>
<violation number="2" location="companion/components/screens/EditAvailabilityOverrideScreen.android.tsx:258">
P2: Editing an override skips the duplicate-date check, allowing two overrides for the same date</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| setSelectedDate(dateStringToDate(override.date ?? "")); | ||
| const start = override.startTime ?? "00:00"; | ||
| const end = override.endTime ?? "00:00"; | ||
| setIsUnavailable(start === "00:00" && end === "00:00"); |
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.
P2: Unavailable override misdetected when API returns times with seconds, blocking save due to failed time validation
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At companion/components/screens/EditAvailabilityOverrideScreen.android.tsx, line 110:
<comment>Unavailable override misdetected when API returns times with seconds, blocking save due to failed time validation</comment>
<file context>
@@ -0,0 +1,449 @@
+ setSelectedDate(dateStringToDate(override.date ?? ""));
+ const start = override.startTime ?? "00:00";
+ const end = override.endTime ?? "00:00";
+ setIsUnavailable(start === "00:00" && end === "00:00");
+ setStartTime(timeStringToDate(start === "00:00" ? "09:00" : start));
+ setEndTime(timeStringToDate(end === "00:00" ? "17:00" : end));
</file context>
|
|
||
| if (isEditing && overrideIndex !== undefined) { | ||
| // Update existing override | ||
| newOverrides[overrideIndex] = newOverride; |
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.
P2: Editing an override skips the duplicate-date check, allowing two overrides for the same date
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At companion/components/screens/EditAvailabilityOverrideScreen.android.tsx, line 258:
<comment>Editing an override skips the duplicate-date check, allowing two overrides for the same date</comment>
<file context>
@@ -0,0 +1,449 @@
+
+ if (isEditing && overrideIndex !== undefined) {
+ // Update existing override
+ newOverrides[overrideIndex] = newOverride;
+ } else {
+ // Check if date already exists
</file context>
What does this PR do?
Visual Demo (For contributors especially)
android-picker-demo.mp4
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Checklist