jQuery Datepicker Plugin For Persian Date - persianDatepicker

jQuery Datepicker Plugin For Persian Date - persianDatepicker
File Size: 581 KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

PersianDatepicker is a jQuery datepicker plugin designed for Persian(Jalali) date that supports Persian numbers and Gregorian date.

Basic Usage:

1. Include the jQuery javascript library and jQuery PersianDatepicker;'s files on the web page.

<link type="text/css" rel="stylesheet" href="css/persianDatePicker-default.css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script type="text/javascript" src="js/persianDatePicker.js"></script>

2. Create an container for the datapicker plugin.

<input type="text" id="demo" placeholder="select date" />

3. Call the plugin with default options.

$(function() {
  $("#demo").persianDatepicker();
});

4. All the options to customize the persian date picker.

$("#demo").persianDatepicker({
  months: ["فروردین", "اردیبهشت", "خرداد", "تیر", "مرداد", "شهریور", "مهر", "آبان", "آذر", "دی", "بهمن", "اسفند"],
  dowTitle: ["شنبه", "یکشنبه", "دوشنبه", "سه شنبه", "چهارشنبه", "پنج شنبه", "جمعه"],
  shortDowTitle: ["ش", "ی", "د", "س", "چ", "پ", "ج"],
  showGregorianDate: !1,
  persianNumbers: !0,
  formatDate: "YYYY/MM/DD",
  selectedBefore: !1,
  selectedDate: null, // '1394/11/12'
  startDate: null, // '1394/11/12'
  endDate: null, // '1395/5/5'
  prevArrow: '\u25c4',
  nextArrow: '\u25ba',
  theme: 'default', // 'dark', 'latoja', 'lightorange', 'melon'
  alwaysShow: !1,
  selectableYears: null,
  selectableMonths: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
  cellWidth: 25, // by px
  cellHeight: 20, // by px
  fontSize: 13, // by px                
  isRTL: !1,
  closeOnBlur: !0,
  calendarPosition: {
    x: 0,
    y: 0,
  },
  onShow: function () {
  },
  onHide: function () {
  },
  onSelect: function () {
  },
  onRender: function () {
  }
});

Changelog:

2019-02-12

    • fix leapyear bug
    • added onRender function

2018-04-29

  • JS updated.

2016-11-14

  • fix z-index isuss CSS

2016-11-13

  • Add onRender function listener

2016-08-02

  • fix data-jdate attr

2016-06-16

  • add data-gdate and data-jdate on select
  • fix $().data issus

2016-05-26

  • fix z-index isuss CSS

2016-05-03

  • function ( $ ) (jQuery)

2015-11-15

  • Added always show option

2015-07-26

  • Added more options.

2015-02-09

  • Added persianDatepicker-melon.css theme.
  • Update persianDatepicker.min.js.

This awesome jQuery plugin is developed by behzadi. For more Advanced Usages, please check the demo page or visit the official website.