Skip to content

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

License

Notifications You must be signed in to change notification settings

AliAminiCode/flet-persian-datepicker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages