jQuery Datepicker Plugin For Persian Date - persianDatepicker

jQuery Datepicker Plugin For Persian Date - persianDatepicker

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.10.2/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.

<script type="text/javascript">
$(function() {
$("#demo").persianDatepicker();
});
</script>

5. All the options..

months: ["فروردین", "اردیبهشت", "خرداد", "تیر", "مرداد", "شهریور", "مهر", "آبان", "آذر", "دی", "بهمن", "اسفند"],
dowTitle: ["شنبه", "یکشنبه", "دوشنبه", "سه شنبه", "چهارشنبه", "پنج شنبه", "جمعه"],
shortDowTitle: ["ش", "ی", "د", "س", "چ", "پ", "ج"],
showGregorianDate: !1,
persianNumbers: !0,
formatDate: "YYYY/MM/DD",
selectedBefore: !1,
selectedDate: null,
startDate: null,
endDate: null,
prevArrow: '\u25c4',
nextArrow: '\u25ba',
theme: 'default',
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 () {
}

Change logs:

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.

  • Publication date: 29.04.2018
  • Source