Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mitosch/textual-datepicker
A datepicker for textual.
https://github.com/mitosch/textual-datepicker
Last synced: 3 months ago
JSON representation
A datepicker for textual.
- Host: GitHub
- URL: https://github.com/mitosch/textual-datepicker
- Owner: mitosch
- License: mit
- Created: 2022-12-29T09:41:48.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-25T09:50:37.000Z (almost 2 years ago)
- Last Synced: 2024-08-27T09:08:55.353Z (6 months ago)
- Language: Python
- Size: 145 KB
- Stars: 21
- Watchers: 1
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-textualize-projects - Datepicker - A datepicker for textual. (Community / Third Party Applications)
README
# Textual: DatePicker
A DatePicker widget for [textual](https://github.com/Textualize/textual). It can be used standalone or with a DateSelect opening the dialog.
DateSelect with DatePicker example:
![DateSelect with DatePicker](https://user-images.githubusercontent.com/922559/209947716-3ee53f74-4d98-4d9c-a261-afb84955d519.png)
## Usage
```python
from textual_datepicker import DateSelectDateSelect(
placeholder="please select",
format="YYYY-MM-DD",
picker_mount="#main_container"
)
```Define an initial value:
```python
import pendulum
from textual_datepicker import DateSelectDateSelect(
placeholder="please select",
format="YYYY-MM-DD",
date=pendulum.parse("2023-02-14"),
picker_mount="#main_container"
)
```## Installation
```bash
pip install textual-datepicker
```Requires textual 0.6.0 or later.
## Limitations
This textual widget is in early stage and has some limitations:
* It can only open below, not above: Make sure to reserve space below for the dialog.
* It needs a specific mount point (`picker_mount`) where the dialog
shall appear. This is needed because the container widget with the select
itself could be too small. Maybe in future versions this will no longer be
needed.