Skip to content

mrezanomani/livewire-jalali-datepicker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Livewire Jalali Datepicker

A lightweight, Alpine.js-based Jalali (Persian) datepicker for Laravel Livewire 3 β€” with full Livewire 3 support, wire:model compatibility, and no need for jQuery or npm packages.


βœ… Features

  • Jalali (Persian) calendar support
  • Compatible with Livewire 3
  • Alpine.js powered
  • Lightweight, no Vue/React
  • Optional time selection
  • Works out of the box via CDN

πŸ“¦ Installation

1. Install via Composer (local or from GitHub)

composer require mrezanomani/livewire-jalali-datepicker

If installing from GitHub directly, use:

composer require mrezanomani/livewire-jalali-datepicker:@dev

πŸ“ Publish views (optional)

If you want to customize the blade view:

php artisan vendor:publish --tag=views

πŸ›  Setup JS & CSS (via CDN)

Add the following to your main Blade layout (e.g. resources/views/layouts/app.blade.php):

In <head>:

<link
  rel="stylesheet"
  href="https://unpkg.com/persian-datepicker@1.2.0/dist/css/persian-datepicker.min.css"
/>

Before closing </body> tag:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="https://unpkg.com/persian-date@1.1.0/dist/persian-date.min.js"></script>
<script src="https://unpkg.com/persian-datepicker@1.2.0/dist/js/persian-datepicker.min.js"></script>

ℹ️ No need to use npm or Vite build. This component works with CDN scripts!


βœ… Usage

In any Blade file:

<x-jalali-datepicker
    wire:model="date"
    format="YYYY-MM-DD"
    :with-time="false"
/>

In Livewire component:

public string $date = '';

🧩 Parameters

Prop Type Description
wire:model string Livewire bound model
format string Output format (default: YYYY-MM-DD)
with-time boolean Enable time picker (default: false)

🀝 Contributing

Pull requests are welcome!
If you encounter a bug or want a new feature, feel free to open an issue.


πŸ“„ License

MIT Β© Mrezanomani

About

jalali datepicker for livewire

Resources

Stars

Watchers

Forks

Packages

No packages published