Skip to content

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

Merged
bennybp merged 4 commits intomainfrom
config_duration
Jan 8, 2025
Merged

Ability to specify times/durations in config as user-friendly strings#876
bennybp merged 4 commits intomainfrom
config_duration

Conversation

@bennybp
Copy link
Copy Markdown
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
@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