PHPackages                             karnoweb/livewire-datepicker - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. karnoweb/livewire-datepicker

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

karnoweb/livewire-datepicker
============================

Jalali/Gregorian datepicker for Livewire 3 &amp; 4 with Alpine.js

v1.0.6(4mo ago)052↓92.9%MITJavaScriptPHP ^8.2

Since Feb 7Pushed 4mo agoCompare

[ Source](https://github.com/karnoweb/livewire-datepicker)[ Packagist](https://packagist.org/packages/karnoweb/livewire-datepicker)[ RSS](/packages/karnoweb-livewire-datepicker/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependencies (3)Versions (8)Used By (0)

karnoweb/livewire-datepicker
============================

[](#karnoweblivewire-datepicker)

Datepicker component for **Livewire 3** with **Alpine.js**, supporting **Jalali (Persian)** and **Gregorian** calendars. Suitable for Laravel applications that need Persian date selection with optional Gregorian export.

---

Features
--------

[](#features)

- **Jalali &amp; Gregorian** — Display and select dates in Persian (Jalali) or Gregorian calendar
- **Livewire 3** — Full integration with `wire:model` (single, range, multiple)
- **Alpine.js** — No jQuery; lightweight and reactive
- **Export format** — Show Jalali in UI but store Gregorian (e.g. `Y-m-d`) in database
- **Date range** — Select start and end date
- **Multiple selection** — Select multiple dates with optional `maxSelections`
- **Min/Max &amp; disabled dates** — Limit selectable dates
- **Theme** — Light, dark, or auto (follows system)
- **RTL** — Right-to-left layout for Persian
- **Accessible** — ARIA attributes and keyboard navigation
- **Customizable** — Config file and optional view/asset publishing

---

Requirements
------------

[](#requirements)

- PHP ^8.2
- Laravel ^11.0 | ^12.0
- Livewire ^3.0 | ^4.0
- Alpine.js (included with Livewire)

No extra npm packages or Vite setup are required in your app — the component loads its script automatically (jalaali-js is bundled inside the package).

Calendar conversion (tested packages)
-------------------------------------

[](#calendar-conversion-tested-packages)

- **PHP:** [morilog/jalali](https://github.com/morilog/jalali) (^3.4) — Jalali/Gregorian conversion; used by the package helpers `jalali_to_gregorian()` and `gregorian_to_jalali()`.
- **JavaScript:** [jalaali-js](https://github.com/jalaali/jalaali-js) — Borkowski algorithm; bundled inside the package and served automatically.

---

Installation
------------

[](#installation)

```
composer require karnoweb/livewire-datepicker
```

### Publish config (optional)

[](#publish-config-optional)

```
php artisan vendor:publish --tag=datepicker-config
```

Edit `config/datepicker.php` to set default formats, theme, first day of week, and locale strings.

The datepicker script (including jalaali-js) is loaded automatically when you use ``. No npm install or Vite entry in your app is required.

---

Usage
-----

[](#usage)

The component is registered as **``** to avoid collision with Mary-UI's ``.

### Basic (Jalali, single date)

[](#basic-jalali-single-date)

```

```

### With label and placeholder

[](#with-label-and-placeholder)

```

```

### Gregorian calendar (display)

[](#gregorian-calendar-display)

```

```

### Show Jalali, store Gregorian

[](#show-jalali-store-gregorian)

Useful when the database column is a standard date (`Y-m-d`):

```

```

### Date range

[](#date-range)

```

```

`wire:model` will receive an object like `{ "start": "1403/01/01", "end": "1403/01/15" }` (or Gregorian if `export-calendar="gregorian"`).

### Multiple dates

[](#multiple-dates)

```

```

Optional: limit number of selections:

```

```

### Min / max date

[](#min--max-date)

```

```

Use the same format as `input-format` (default `Y/m/d` for Jalali).

### Disabled dates

[](#disabled-dates)

Pass an array of date strings in the same format:

```

```

### Custom formats

[](#custom-formats)

- **input-format** — Format shown in the input and used for min/max/disabled (e.g. `Y/m/d`, `d/m/Y`).
- **export-format** — Format sent to Livewire (e.g. `Y-m-d`, `Y/m/d`).

```

```

### Theme

[](#theme)

- `light` / `dark` / `auto` (default from config). Override:

```

```

### Position

[](#position)

Dropdown position (e.g. `bottom-start`, `top-end`):

```

```

### Inline

[](#inline)

Show calendar always open (no dropdown):

```

```

### Required / disabled

[](#required--disabled)

```

```

### Default value

[](#default-value)

Set initial value (same format as export):

```

```

---

Component attributes
--------------------

[](#component-attributes)

AttributeTypeDefaultDescription`wire:model`string—Livewire property (required for binding)`id`stringautoUnique ID for the wrapper`label`stringnullLabel text above the input`jalali`booltrueUse Jalali (true) or Gregorian (false)`range`boolfalseEnable date range selection`multiple`boolfalseAllow multiple date selection`required`boolfalseHTML required`disabled`boolfalseDisable input`inline`boolfalseAlways show calendar (no dropdown)`min-date`stringnullMinimum selectable date`max-date`stringnullMaximum selectable date`disabled-dates`array\[\]List of disabled date strings`input-format`stringfrom configDisplay/input format (e.g. Y/m/d)`export-format`stringfrom configValue format sent to Livewire (e.g. Y-m-d)`export-calendar`stringsame`same` or `gregorian` (when jalali=true)`placeholder`stringlocale defaultInput placeholder`default`stringnullInitial value`theme`stringfrom configlight / dark / auto`position`stringbottom-startDropdown position`max-selections`intnullMax dates when multiple=true---

Configuration
-------------

[](#configuration)

After publishing config (`config/datepicker.php`):

- **default\_calendar** — `jalali` or `gregorian`
- **formats.input** — Default input/display format (e.g. `Y/m/d`)
- **formats.export** — Default export format (e.g. `Y-m-d`)
- **jalali** / **gregorian** — Month and weekday names for i18n
- **theme** — `auto`, `light`, or `dark`
- **first\_day\_of\_week** — 0 (Sunday) or 6 (Saturday) for Gregorian/Jalali
- **holidays** — Reserved for future use

---

Helper functions (PHP)
----------------------

[](#helper-functions-php)

The package provides two helpers for server-side conversion:

```
use function Karnoweb\LivewireDatepicker\gregorian_to_jalali;
use function Karnoweb\LivewireDatepicker\jalali_to_gregorian;

// Gregorian to Jalali: year, month, day
$j = gregorian_to_jalali(2024, 3, 20);
// ['year' => 1403, 'month' => 1, 'day' => 1]

// Jalali to Gregorian
$g = jalali_to_gregorian(1403, 1, 1);
// ['year' => 2024, 'month' => 3, 'day' => 20]
```

---

Publishing views / assets
-------------------------

[](#publishing-views--assets)

- **Config:** `php artisan vendor:publish --tag=datepicker-config`
- **Views:** `php artisan vendor:publish --tag=datepicker-views` → customize Blade under `resources/views/vendor/datepicker`
- **Assets (optional):** `php artisan vendor:publish --tag=datepicker-assets` → copies raw JS sources to `public/vendor/datepicker` (only if you want to build them in your app; normally the bundled script is served by the package)

---

Namespace
---------

[](#namespace)

- **Package:** `karnoweb/livewire-datepicker`
- **PHP namespace:** `Karnoweb\LivewireDatepicker`
- **Blade component:** `` (prefix `jalali` to avoid Mary-UI collision)

---

Releasing a new version
-----------------------

[](#releasing-a-new-version)

So clients can get the latest changes via Composer, each release must be tagged. Steps:

1. **Bump version** in `composer.json` (e.g. `1.0.2` → `1.0.3`).
2. **Rebuild the JS bundle** (if you changed `resources/js/`): run `npm install && npm run build` and commit `dist/datepicker.js`.
3. **Commit** your changes: ```
    git add .
    git commit -m "v1.0.3: your message"
    ```
4. **Create tag** (match the version in composer.json): ```
    git tag v1.0.3
    ```
5. **Push** branch and tags: ```
    git push && git push --tags
    ```

Clients using `"karnoweb/livewire-datepicker": "^1.0"` can then run `composer update karnoweb/livewire-datepicker` to get the new release.

---

License
-------

[](#license)

MIT.

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance75

Regular maintenance activity

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

7

Last Release

139d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a6a881e293406595d74617357c2477180a2a48cb6613acb3395652bd00147f78?d=identicon)[sajadsoft1](/maintainers/sajadsoft1)

---

Top Contributors

[![sajadsoft1](https://avatars.githubusercontent.com/u/10587549?v=4)](https://github.com/sajadsoft1 "sajadsoft1 (15 commits)")

---

Tags

laravellivewireJalalidatepickeralpinepersian

### Embed Badge

![Health badge](/badges/karnoweb-livewire-datepicker/health.svg)

```
[![Health](https://phpackages.com/badges/karnoweb-livewire-datepicker/health.svg)](https://phpackages.com/packages/karnoweb-livewire-datepicker)
```

###  Alternatives

[livewire/flux

The official UI component library for Livewire.

9527.8M128](/packages/livewire-flux)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.4k](/packages/tomshaw-electricgrid)[venturedrake/laravel-crm

A free open source CRM built as a package for laravel projects

43311.1k](/packages/venturedrake-laravel-crm)[drpshtiwan/livewire-async-select

A powerful async select component for Laravel Livewire with Alpine.js - a modern alternative to Select2

1116.8k](/packages/drpshtiwan-livewire-async-select)[tanthammar/livewire-window-size

Laravel blade directives and php helpers for serverside rendered content, based on browser window size WITHOUT css. Requires Livewire and AlpineJS

2324.0k](/packages/tanthammar-livewire-window-size)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
