Skip to content

Conversation

@vijay2909
Copy link

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

  1. 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
  1. 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
  1. 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
  1. 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

- Implement time picker flow after date selection
- Migrate database from millis to ISO 8601 datetime strings
- Add DateTimeUtils helper methods with comprehensive tests
@TheLastProject
Copy link
Member

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 :)

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.

Allow setting valid from/expiry time

3 participants