# `gradio_calendar` Gradio component for selecting dates with a calendar 📆 ## Installation ```bash pip install gradio_calendar ``` ## Usage ```python import gradio as gr from gradio_calendar import Calendar import datetime def is_weekday(date: datetime.datetime): return date.weekday() < 5 demo = gr.Interface(is_weekday, [Calendar(type="datetime", label="Select a date", info="Click the calendar icon to bring up the calendar.")], gr.Label(label="Is it a weekday?"), examples=["2023-01-01", "2023-12-11"], cache_examples=True, title="Is it a weekday?") if __name__ == "__main__": demo.launch() ``` ## `Calendar` ### Initialization
name | type | default | description |
---|---|---|---|
value |
```python str | datetime.datetime ``` | None |
None |
type |
```python "string" | "datetime" ``` | "datetime" |
None |
label |
```python str | None ``` | None |
None |
info |
```python str | None ``` | None |
None |
show_label |
```python bool | None ``` | None |
None |
container |
```python bool ``` | True |
None |
scale |
```python int | None ``` | None |
None |
min_width |
```python int | None ``` | None |
None |
interactive |
```python bool | None ``` | None |
None |
visible |
```python bool ``` | True |
None |
elem_id |
```python str | None ``` | None |
None |
elem_classes |
```python list[str] | str | None ``` | None |
None |
render |
```python bool ``` | True |
None |
load_fn |
```python Callable[Ellipsis, Any] | None ``` | None |
None |
every |
```python float | None ``` | None |
None |