Metadata-Version: 2.4
Name: qjalalicalendarwidget
Version: 0.2.1
Summary: A modern Jalali (Persian) calendar widget for PySide6
Author: Reza
License: MIT License
        
        Copyright (c) 2026 Reza
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: PySide6>=6.9
Requires-Dist: jdatetime>=4.0
Dynamic: license-file

# 📅 QJalaliCalendarWidget

> A modern, customizable Jalali (Persian) calendar widget for PySide6\
> ویجت تقویم جلالی حرفه‌ای و قابل شخصی‌سازی برای PySide6

------------------------------------------------------------------------

## 🌟 Features \| ویژگی‌ها

### 🇬🇧 English

-   ✅ Jalali (Persian) calendar support\
-   ✅ Built with **PySide6**
-   ✅ Right-to-left (RTL) layout support
-   ✅ Customizable theme colors
-   ✅ Persian / English digit modes
-   ✅ Keyboard navigation
-   ✅ Date range restriction (min/max)
-   ✅ Custom month & weekday names
-   ✅ Qt-style signals (`selectionChanged`, `activated`, etc.)
-   ✅ Modern UI design

------------------------------------------------------------------------

### 🇮🇷 فارسی

-   ✅ پشتیبانی کامل از تقویم جلالی (شمسی)
-   ✅ توسعه داده شده با PySide6
-   ✅ پشتیبانی کامل از راست‌به‌چپ (RTL)
-   ✅ قابلیت شخصی‌سازی رنگ‌ها (تم)
-   ✅ نمایش اعداد فارسی یا انگلیسی
-   ✅ ناوبری با کیبورد
-   ✅ محدودسازی بازه تاریخ (حداقل/حداکثر)
-   ✅ امکان تغییر نام ماه‌ها و روزهای هفته
-   ✅ سیگنال‌های مشابه QCalendarWidget
-   ✅ طراحی مدرن و تمیز

------------------------------------------------------------------------

## 📷 Screenshot \| تصویر ویجت

Add your screenshot inside: `docs/screenshot.png`

------------------------------------------------------------------------

## 📦 Installation \| نصب

``` bash
pip install qjalalicalendarwidget
```

------------------------------------------------------------------------

## 🚀 Basic Usage \| مثال استفاده

``` python
import sys
from PySide6.QtWidgets import QApplication

from qjalalicalendarwidget import QJalaliCalendarWidget

app = QApplication(sys.argv)


def on_date_confirmed(selected_date):
    print(selected_date.strftime("%Y/%m/%d"))
    app.quit()


def move_to_center(calendar):
    from PySide6.QtGui import QGuiApplication

    calendar.adjustSize()

    # --- Center of Screen ---
    screen = QGuiApplication.primaryScreen()
    screen_geometry = screen.availableGeometry()

    calendar.resize(calendar.sizeHint())
    x = (screen_geometry.width() - calendar.width()) // 2
    y = (screen_geometry.height() - calendar.height()) // 2

    calendar.move(x, y)


calendar = QJalaliCalendarWidget()
calendar.confirmed.connect(on_date_confirmed)

move_to_center(calendar)
calendar.show()

sys.exit(app.exec())
```

------------------------------------------------------------------------

## 🎨 Customization \| شخصی‌سازی

### Change Digit Mode \| تغییر حالت اعداد

``` python
calendar.setDigitMode("fa")  # Persian digits
calendar.setDigitMode("en")  # English digits
```

------------------------------------------------------------------------

### Set Date Range \| تعیین بازه تاریخ

``` python
import jdatetime

calendar.setMinimumDate(jdatetime.date(1403, 1, 1))
calendar.setMaximumDate(jdatetime.date(1404, 12, 29))
```

------------------------------------------------------------------------

### Customize Theme Colors \| تغییر رنگ‌ها

``` python
calendar.setThemeColors(
    selected_bg="#2e7d32",
    selected_fg="#ffffff",
    today_bg="#e8f5e9",
    friday_fg="#d32f2f"
)
```

------------------------------------------------------------------------

## ⌨ Keyboard Navigation \| ناوبری با کیبورد

  Key                       Action
  ------------------------- ---------------------------
  ← →                       Previous / Next day
  ↑ ↓                       Previous / Next week
  PageUp / PageDown         Previous / Next month
  Shift + PageUp/PageDown   Previous / Next year
  Home / End                First / Last day of month
  Enter                     Confirm selection

------------------------------------------------------------------------

## 🔔 Signals \| سیگنال‌ها

``` python
calendar.selectionChanged.connect(...)
calendar.activated.connect(...)
calendar.currentPageChanged.connect(...)
calendar.dateSelected.connect(...)
```

------------------------------------------------------------------------

## 📋 Requirements \| پیش‌نیازها

-   Python 3.9+
-   PySide6
-   jdatetime

------------------------------------------------------------------------

## 📄 License \| مجوز

MIT License

------------------------------------------------------------------------

## 🤝 Contributing \| مشارکت

Pull requests are welcome.\
For major changes, please open an issue first.

از پیشنهادها و مشارکت شما استقبال می‌شود.

------------------------------------------------------------------------

## ⭐ Support

If you find this project useful, consider giving it a ⭐ on GitHub.
