Skip to content

Comments

Add dite/time input with default value with a defined range#425

Open
RafikLkr wants to merge 3 commits intotmbo:masterfrom
RafikLkr:date
Open

Add dite/time input with default value with a defined range#425
RafikLkr wants to merge 3 commits intotmbo:masterfrom
RafikLkr:date

Conversation

@RafikLkr
Copy link

@RafikLkr RafikLkr commented Jan 27, 2025

What is the problem that this PR addresses?

This PR addresses the need to verify the handling of default values and the validation of date input prompts. Specifically, it ensures that when the user presses "Enter" without providing a date, the default date value is correctly returned. Additionally, this PR introduces functionality to validate if the input date falls within a defined range, with a minimum and maximum date that can be specified.

Closes #121 (assuming this is the issue related to the functionality being tested)

How did you solve it?

I implemented a unit test for the date input prompt. The test simulates a scenario where the user presses "Enter" without providing a date, which should return the default value specified (in this case, "2023-01-01"). The test uses create_pipe_input to simulate the user input and DummyOutput to handle output, verifying that the expected default value is returned correctly.

Checklist

  • I have read the Contributor's Guide.
  • I will check that all automated PR checks pass before the PR gets reviewed.

Copy link
Owner

@tmbo tmbo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great, thanks for this additional feature

@tmbo tmbo enabled auto-merge August 28, 2025 19:30
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.

Add a date/time input

2 participants