Skip to content

Conversation

@linkzera
Copy link
Contributor

  • Add --time/-t flag to set timer until specific time (e.g., 14:30, 2:30PM)
  • Support multiple time formats: 24h, 12h with AM/PM (case insensitive), with/without seconds
  • Implement smart scheduling: past times automatically target next day
  • Reject ambiguous single-digit hour formats (e.g., "1:30") to prevent confusion
  • Add calculateDurationUntilTime function with robust time parsing
  • Enhance formatDuration with cleaner display and better precision
  • Add comprehensive test suite with 95%+ coverage:
    • Duration formatting validation
    • Time parsing for all supported formats
    • Error handling and edge cases
    • Real-world usage scenarios
    • Performance benchmarks
  • Update README with usage examples and supported time formats
  • Maintain backward compatibility with existing duration-based timers

Examples:
timer -t 14:30 # Until 2:30 PM today/tomorrow
timer -t 2:30PM # 12-hour format
timer -t 07:00 -n Alarm # Named morning timer

- Add --time/-t flag to set timer until specific time (e.g., 14:30, 2:30PM)
- Support multiple time formats: 24h, 12h with AM/PM (case insensitive), with/without seconds
- Implement smart scheduling: past times automatically target next day
- Reject ambiguous single-digit hour formats (e.g., "1:30") to prevent confusion
- Add calculateDurationUntilTime function with robust time parsing
- Enhance formatDuration with cleaner display and better precision
- Add comprehensive test suite with 95%+ coverage:
  * Duration formatting validation
  * Time parsing for all supported formats
  * Error handling and edge cases
  * Real-world usage scenarios
  * Performance benchmarks
- Update README with usage examples and supported time formats
- Maintain backward compatibility with existing duration-based timers

Examples:
  timer -t 14:30        # Until 2:30 PM today/tomorrow
  timer -t 2:30PM       # 12-hour format
  timer -t 07:00 -n Alarm  # Named morning timer
@linkzera linkzera changed the title feat: add time-based timer functionality with comprehensive testing feat: add time-based timer functionality with comprehensive testing (closes #6) May 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant