Skip to content
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

UI: Refactor DateTime formatting and selection handling #403

Merged
merged 1 commit into from
Nov 30, 2024

Conversation

ksharma-xyz
Copy link
Owner

@ksharma-xyz ksharma-xyz commented Nov 30, 2024

TL;DR

Refactored date-time handling and selection functionality to improve code organization and reusability.

What changed?

  • Renamed date/time formatting functions to be more descriptive (formatDate -> toReadableDate, formatTime -> to12HourTimeString)
  • Moved DateTimeSelectionItem and JourneyTimeOptions to the state module
  • Added documentation to time formatting functions
  • Added date-time selection handling to TimeTableViewModel
  • Added comma separator in date format for better readability

How to test?

  1. Open the date-time selector screen
  2. Verify date formats display correctly (Today, Tomorrow, Mon, 1 Jan)
  3. Verify time formats display in 12-hour format (1:30 PM)
  4. Test journey time options (Leave/Arrive) work correctly
  5. Confirm date-time selection updates properly in the time table view

Why make this change?

  • Improves code organization by moving date-time related logic to appropriate modules
  • Makes the code more maintainable with better-named functions and documentation
  • Enhances readability of displayed dates with consistent formatting
  • Centralizes date-time selection handling in the ViewModel for better state management

@ksharma-xyz ksharma-xyz changed the title Refactor add state objects UI: Refactor DateTime formatting and selection handling Nov 30, 2024
Copy link
Owner Author

ksharma-xyz commented Nov 30, 2024

@ksharma-xyz ksharma-xyz marked this pull request as ready for review November 30, 2024 05:22
@ksharma-xyz ksharma-xyz force-pushed the 11-30-update_api_to_accept_date_and_time_parameters branch 2 times, most recently from 8ba3765 to 17e4db6 Compare November 30, 2024 05:28
@ksharma-xyz ksharma-xyz force-pushed the 11-30-refactor_add_state_objects branch from 1c56ca2 to 2fcbaea Compare November 30, 2024 05:28
@ksharma-xyz ksharma-xyz changed the base branch from 11-30-update_api_to_accept_date_and_time_parameters to graphite-base/403 November 30, 2024 05:37
@ksharma-xyz ksharma-xyz force-pushed the 11-30-refactor_add_state_objects branch from 2fcbaea to 67b1586 Compare November 30, 2024 05:37
@ksharma-xyz ksharma-xyz changed the base branch from graphite-base/403 to main November 30, 2024 05:38
@ksharma-xyz ksharma-xyz force-pushed the 11-30-refactor_add_state_objects branch from 67b1586 to a556296 Compare November 30, 2024 05:38
@ksharma-xyz ksharma-xyz merged commit ad9ff93 into main Nov 30, 2024
2 checks passed
Copy link
Owner Author

Merge activity

  • Nov 30, 8:18 AM EST: A user merged this pull request with Graphite.

@ksharma-xyz ksharma-xyz deleted the 11-30-refactor_add_state_objects branch November 30, 2024 13:18
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.

1 participant