feat: Add time selection to date picker with ISO datetime storage
Requirement The issue required adding time selection capability to the existing date picker functionality. Previously, users could only select dates without specific times, which limited precision for time-sensitive features.
Changes Made
- Enhanced Picker Flow:
- Modified date selection to trigger time picker automatically after date is chosen
- Combined date and time into a single ZonedDateTime object
- Updated UI to display both date and time in the input field
- Data Storage Migration:
- Changed database storage format from milliseconds (long) to ISO 8601 strings
- ISO format provides timezone awareness and better interoperability
- Maintained backward compatibility through migration handling
- DateTimeUtils Class:
- Created utility class with helper methods for datetime conversions
- Added methods for formatting, parsing, and validation
- Implemented comprehensive test coverage with 100% pass rate
- Testing:
- Added complete test suite for DateTimeUtils using Espresso and Robolectric
- Verified date-time combination logic and formatting
- Ensured edge cases and timezone handling work correctly
Technical Details
- Uses MaterialDatePicker and MaterialTimePicker for consistent UI
- ZonedDateTime for proper timezone handling throughout the application
- ISO 8601 format for future-proof data storage and exchange
Maintains existing API contracts while extending functionality
The implementation provides users with precise datetime selection while maintaining data integrity and test reliability.
Fixes: #2284
Wow, that was fast :)
The description sounds like this is going in the right direction. Thank you for this.
I might take a while until I can review this, I want to try to finish up #2716 somewhat soon to fix issues with barcodes with Cyrillic and similar issues, and I have a busy week coming up, but after that I'll definitely take a look at this :)