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

Ability to specify times/durations in config as user-friendly strings #876

Merged
merged 4 commits into from
Jan 8, 2025

Conversation

bennybp
Copy link
Contributor

@bennybp bennybp commented Jan 8, 2025

Description

For various fields, the config requires you to specify the time something takes in seconds. This is not ideal for long durations (hours to days). This PR adds the ability to specify these in three ways:

  • As integer or string seconds (same as before): 90, "90"
  • As dhms with a colon separator: 1:04:08:10 (1 day, 4 hours, 8 minutes, 10 seconds)
  • As dhms with a suffix for each part: 1d4h7s (1 day, 4 hours, 7 seconds)

The conversion code is tolerant of leading zeros and weird quantities (ie, 1d77h99m99s)

Status

  • Code base linted
  • Ready to go

@bennybp bennybp merged commit f5b076e into main Jan 8, 2025
15 checks passed
@bennybp bennybp deleted the config_duration branch January 8, 2025 23:45
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