Download the PHP package pdatepicker/persian-datepicker without Composer

On this page you can find all versions of the php package pdatepicker/persian-datepicker. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package persian-datepicker

Persian Datepicker for Laravel

A modern, elegant, and feature-rich Persian (Jalali) datepicker package for Laravel applications, with extensive customization options.

Persian Datepicker

Features

Laravel Compatibility

Laravel Version Package Version
10.x 1.x
9.x 1.x
8.x 1.x

Requirements

Installation

Step 1: Install via Composer

Step 2: Publish Assets and Configuration

For Laravel apps, publish the necessary assets and configuration file:

This will:

Step 3: Add to Your Layout

Add the CSS and JavaScript files to your layout:

Laravel Integration

Using in Blade Templates

You can use the provided Blade directive to easily add datepickers to your forms:

With Laravel Collective Forms

If you're using Laravel Collective's form package:

Validation

For form validation, use the jalali_date validation rule:

Or use the rule in your form request:

Working with Laravel Models

Accessors and Mutators

Use accessors and mutators to automatically convert between Jalali and Gregorian dates:

Examples

The package includes several complete examples to demonstrate different usage scenarios:

After publishing the assets, you can find these examples at:

Or you can view them directly in the source code at:

Configuration Options

You can configure default behavior by editing the config/pdatepicker.php file:

Available Options

Option Type Default Description
format string 'YYYY/MM/DD' Date format
theme string 'default' Datepicker theme ('default', 'dark', 'blue')
rtl boolean true Enable RTL mode
language string 'fa' Language ('fa', 'en')
autoClose boolean true Close datepicker after selecting a date
timePicker boolean false Show time picker
timeFormat string 'HH:mm:ss' Format for time display
type string 'date' Calendar type ('date', 'month', 'year')
viewMode string 'day' Initial view mode ('day', 'month', 'year')
minDate string null Minimum selectable date
maxDate string null Maximum selectable date
initialValue string null Initial date value
position string 'bottom' Datepicker position ('bottom', 'top')
altField string null Alternative field selector
altFormat string null Alternative field format
onSelect function null Callback when a date is selected
onShow function null Callback when datepicker is shown
onHide function null Callback when datepicker is hidden
customStyles object {} Custom CSS styles for datepicker elements

Methods

PHP Methods (Available via Facade)

Method Description
toJalali($date, $format = 'Y/m/d') Convert Gregorian date to Jalali
toGregorian($date, $format = 'Y-m-d') Convert Jalali date to Gregorian
now($format = 'Y/m/d') Get current Jalali date
render($name, $value = null, array $options = []) Render datepicker HTML

JavaScript Methods

Method Description
show() Show the datepicker
hide() Hide the datepicker
setDate(date) Set the datepicker date programmatically
updateStyles(styles) Update datepicker styles dynamically
refreshView() Refresh the calendar view

Additional Resources

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Support

If you discover any issues or have questions, please open an issue on GitHub.

Credits

This package was created by [Your Name/Organization] and is inspired by modern datepicker solutions.

License

The MIT License (MIT). Please see License File for more information.

Using Different Calendar Types

The package supports different calendar types to suit various input needs:

Date Picker (Default)

Month Picker

Year Picker

JavaScript Implementation for Calendar Types

Theming Options

The datepicker comes with several built-in themes:

Default Theme

Dark Theme

Blue Theme

Custom Theme with Inline Styles

Creating a Custom Theme with CSS

You can also create a custom theme using CSS:

  1. Create a CSS file with your theme styles:

  2. Include the CSS file in your layout:

  3. Use the custom theme:

Using the Facade

The package provides a convenient facade for working with dates in your controllers and models:

Events and Callbacks

The datepicker supports various events and callbacks for advanced integrations:

JavaScript Event Handling

Form Integration with Events

Real-time Style Updates

You can dynamically change the datepicker appearance:

Advanced Usage Scenarios

Date Range Selection

Create a date range picker by linking two datepickers:

Multiple Date Selection

Inline Calendar (Without Input Field)

Integrating with AJAX Forms


All versions of persian-datepicker with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3|^8.0
illuminate/support Version *
morilog/jalali Version ^3.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package pdatepicker/persian-datepicker contains the following files

Loading the files please wait ....