Flet Persian DatePicker: Advanced Shamsi/Jalali Date Widget (2025 Release)
Discover a cutting-edge Persian (Shamsi) DatePicker widget designed for Flet, launched in 2025! This powerful Flet Persian DatePicker offers seamless navigation, stunning animations, and full RTL support with Persian numerals, making it ideal for modern Persian apps. Key features include:
- Keyboard Navigation: Effortlessly navigate with Escape (close), Enter (confirm), A/D (previous/next day), and W/S (previous/next week).
- Flexible Themes: Switch between light and dark modes for a tailored user experience.
- Input Mode with Validation: Enter dates directly with smart validation for accuracy.
- Smart Features: Enjoy mode switching, date memory, and a dedicated today button.
Perfect for developers seeking a robust Jalali Calendar solution or a Shamsi Date Widget for Flet projects. Explore more at https://github.com/AliAminiCode/flet-persian-datepicker.
Install the package via pip:
pip install persian-datepicker
v1.5 (See Changelog)
Here’s a simple example to get you started with the Persian DatePicker:
import flet as ft
from persian_datepicker import PersianDatePicker
def main(page: ft.Page):
datepicker = PersianDatePicker()
def handle_result(result):
if result:
print(f"Selected: {result['formatted_persian']}")
datepicker.set_result_callback(handle_result)
def show_datepicker(e):
datepicker.show(page)
page.add(ft.ElevatedButton("Select Date", on_click=show_datepicker))
ft.app(target=main)
Run this code after installing the package to see a basic datepicker with a button to open it. The selected date will be printed in Persian format.
- Customize themes: page.theme_mode = ft.ThemeMode.DARK before showing the datepicker.
- Set default date: datepicker.set_default_date("1404/06/01").
- Validate date range: Check example_mini_project.py for advanced usage.
Check out the Persian DatePicker in action with light and dark themes:
- Light Mode:
- Dark Mode:
Check the examples/
directory for sample code:
example_basic.py
: Basic usage.example_mini_project.py
: A mini project demo.
- Persian calendar with Shamsi dates.
- Floating overlay with modal behavior.
- Comprehensive error handling and validation.
- Performance optimized with LRU cache.
See CHANGELOG.md for detailed version history.
Found a bug? Report it here.
This project is licensed under the MIT License.
Developed by Ali Amini.
Feel free to open issues or pull requests on GitHub. Note: This repository was previously named persian-datepicker. Update your bookmarks to https://github.com/AliAminiCode/flet-persian-datepicker!