kamihi.questions.datetime
⚓︎
Generic datetime reusable question.
License
MIT
Classes:
| Name | Description |
|---|---|
Datetime |
Generic date reusable question. |
Datetime
⚓︎
Datetime(
text: str,
error_text: str = None,
before: datetime | None = None,
after: datetime | None = None,
in_the_past: bool = False,
in_the_future: bool = False,
)
Bases: Question
Generic date reusable question.
Initialize an instance of the Datetime question.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The text of the question. |
required |
|
str
|
The error text to display for invalid responses. Defaults to a value from settings. |
None
|
|
datetime | None
|
The latest acceptable date (exclusive). Defaults to None. |
None
|
|
datetime | None
|
The earliest acceptable date (exclusive). Defaults to None |
None
|
|
bool
|
Whether the date must be in the past. Defaults to False. |
False
|
|
bool
|
Whether the date must be in the future. Defaults to False. |
False
|
Source code in src/kamihi/questions/datetime.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | |