Skip to main content

A Persian (Shamsi) DatePicker widget for Flet with animations, RTL support, and keyboard navigation.

Project description

Flet Persian DatePicker

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.

Installation

Install the package via pip:

pip install persian-datepicker

Current Version

v1.5 (See Changelog)

Quick Start

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.

Advanced Usage

  • 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.

Screenshots

Check out the Persian DatePicker in action with light and dark themes:

  • Light Mode:
Light Mode
  • Dark Mode:
Dark Mode

Usage

Check the examples/ directory for sample code:

  • example_basic.py: Basic usage.
  • example_mini_project.py: A mini project demo.

Features

  • Persian calendar with Shamsi dates.
  • Floating overlay with modal behavior.
  • Comprehensive error handling and validation.
  • Performance optimized with LRU cache.

Changelog

See CHANGELOG.md for detailed version history.

Reporting Issues

Found a bug? Report it here.

License

This project is licensed under the MIT License.
Developed by Ali Amini.

Contribute

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!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

persian_datepicker-1.5.5.tar.gz (18.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

persian_datepicker-1.5.5-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

Details for the file persian_datepicker-1.5.5.tar.gz.

File metadata

  • Download URL: persian_datepicker-1.5.5.tar.gz
  • Upload date:
  • Size: 18.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for persian_datepicker-1.5.5.tar.gz
Algorithm Hash digest
SHA256 938be8f906c994ed3ec19c22cca6e8d830cc6ec456af6871c3842e75a16acb0b
MD5 7405d97ef25892c65f2a0b4ce32274fd
BLAKE2b-256 0abbef514b3158b17d06ba51158bb859dbc6833e3e3625252dbc42d9be9bcb18

See more details on using hashes here.

File details

Details for the file persian_datepicker-1.5.5-py3-none-any.whl.

File metadata

File hashes

Hashes for persian_datepicker-1.5.5-py3-none-any.whl
Algorithm Hash digest
SHA256 8302bc8a0bcf90eb6c0e2e03e3cb6f3f4c9b4fedb9070c4dbfac49c62f94712a
MD5 9a9949795d0765918e02fece8315b81a
BLAKE2b-256 1d972bfd2339bd027b1a90dfdba75b4829e07f26fd953e9c3f0eceb1401d7284

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page