npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

persian-datepicker

v1.2.0

Published

jQuery datepicker plugin work with Iranian calendar.

Downloads

5,541

Readme

Persian Date Picker

This Date picker work with Iranian calendar.

Jalali calendar datepicker, which depends on persianDate

More info at Wikipedia

Note: from v1.0.0 persianDatepicker support gregorian calendar

npm version Bower version Travis-ci

Star Issue Fork

Table of content:

CDN

Dependency

persian-datepicker 1.x.x need persian-date 1.x.x

Install

npm install persian-datepicker

bower install persian-datepicker

Usage

<head>
  <link rel="stylesheet" href="css/persian.datepicker.css"/>
  <script src="js/jquery.js"></script>
  <script src="js/persian.date.js"></script>
  <script src="js/persian.datepicker.js"></script>
</head>

<script type="text/javascript">
  $(document).ready(function() {
    $(".example1").pDatepicker();
  });
</script>

<input type="text" class="example1" />

Options table

Options full document

| name | type | default | description | | ------------- |:-------------: | :----------------------------------------------:| :----------: | | calendarType | string | 'persian' | Set default calendar mode of datepicker, available options: 'persian', 'gregorian' | | calendar | object | | Calendar type and localization configuration | | calendar.persian | object | | Persian calendar configuration | | calendar.persian.locale | string | 'fa' | Set locale of Persian calendar available options: 'fa', 'en' | | calendar.persian.showHint | boolean | false | If set true, small date hint of this calendar will be shown on another calendar | | calendar.persian.leapYearMode | string | algorithmic | Persian calendar leap year calculation mode, available options: 'algorithmic', 'astronomical' | | calendar.gregorian | object | | Gregorian calendar configuration | | calendar.gregorian.locale | string | 'en' | set locale of Gregorian calendar available options: 'fa', 'en' | | calendar.gregorian.showHint | boolean | false | If set true, small date hint of this calendar will be shown on another calendar | | responsive | boolean | true | If set true make enable responsive view on mobile devices | | initialValue | boolean | true | If set true datepicker init with input value date, use data-date property when you want set inline datepicker initial value | | initialValueType | string | 'gregorian' | Initial value calendar type, accept: 'persian', 'gregorian' | | inline | boolean | false | If set true datepicker render inline | | persianDigit (DEPRECATED from 1.0.0) | boolean | true | If set true all digit shows as persian digit | | viewMode | string | 'day' | Accept 'day', 'month', 'year' | | format | string | 'LLLL' | The date format, combination of d, dd, m, mm, yy, yyy. format document | | formatter | function | function(unixDate){return unixDate} | Main Input value formatter function | | altField | string | null | An input element that is to be updated with the selected date from the datepicker. Use the altFormat option to change the format of the date within this field. Leave as blank for no alternate field. acceptable value: : '#elementId','.element-class' | | altFormat | string | 'unix' | The date format, combination of d, dd, m, mm, yy, yyy. format document | | altFieldFormatter | function | function(unixDate){return unixDate} | Format value of alt field input input | | minDate | Unix Offset | null | Set min date on datepicker, prevent user select date before given unix time | | maxDate | Unix Offset | null | Set max date on datepicker, prevent user select date after given unix time | | navigator | object | | Navigator config object | | navigator.enabled | boolean | true | Make navigator enable or disable | | navigator.scroll | object | | Navigate by scroll configuration | | navigator.scroll.enabled | boolean | true | If you want prevent to navigate with mouse-wheel event make this option false | | navigator.text | object | | Navigator text config object | | navigator.text.btnNextText | string | '<' | Text of next button| | navigator.text.btnPrevText | string | '>' | Text of previews button | | navigator.onNext | event | function (navigator) {} | Called when navigator goes to next state | | navigator.onPrev | event | function (navigator) {} | Called when navigator goes to prev state | | navigator.onSwitch | event | function (state) {} | Called when navigator switch | | toolbox | object | | Toolbox object options.| | toolbox.enabled | boolean | true | Enable/Disable toolbox object | | toolbox.text (DEPRECATED from 1.0.0) | object | | | | toolbox.text.btnToday (DEPRECATED from 1.0.0) | string | 'امروز' | Today button text| | toolbox.todayButton | object | | Toolbox today button configuration| | toolbox.todayButton.enabled | boolean | false | Make toolbox today button enable or disable| | toolbox.todayButton.text | object | | Today button text| | toolbox.todayButton.text.fa | string | 'امروز' | Show when current calendar is Persian| | toolbox.todayButton.text.en | string | 'Today' | Show when current calendar is Gregorian| | toolbox.todayButton.onToday | event | function () {} | Called when today button clicked | | toolbox.submitButton | object | | Toolbox today button configuration| | toolbox.submitButton.enabled | boolean | true | Make toolbox submit button enable or disable| | toolbox.submitButton.text | object | | Submit button text| | toolbox.submitButton.text.fa | string | 'تایید' | Show when current calendar is Persian| | toolbox.submitButton.text.en | string | 'submit' | Show when current calendar is Gregorian| | toolbox.submitButton.onSubmit | event | function () {} | Called when submit button clicked | | toolbox.calendarSwitch | object | | | | toolbox.calendarSwitch.enabled | boolean | true | Make calendar switch enable or disable | | toolbox.calendarSwitch.format | string | 'MMMM' | Calendar switch text format string | | toolbox.calendarSwitch.onSwitch| event | function () {} | Called when calendar switch clicked | | toolbox.onToday (DEPRECATED from 0.6.0) | event | function(toolbox){return unixDate} | Event called when today btn clicked| | onlyTimePicker (mode) | boolean | false | If true, all pickers hide and just show timepicker | | onlySelectOnDate | boolean | true | If true, date select just by click on day in month grid, and when user select month or year selected date doesnt change | | checkDate | function | function (unix) { return true; } | Validate date access before render| | checkMonth | function | function (month) { return true; } | Validate month access before render| | checkYear | function | function (year) { return true; } | Validate year access before render| | timePicker | object | | | | timePicker.enabled | boolean | false | Make timePicker enable or disable | | timePicker.step | int | 1 | The amount that increases or decreases by pressing the button | | timePicker.hour | object | | | | timePicker.hour.enabled | boolean | true | Enable/Disable hour in timepPicker object | | timePicker.hour.step | int | null | The amount that increases or decreases hour, by pressing the button. overwrite by timepicker.step | | timePicker.minute | object | | | | timePicker.minute.enabled | boolean | true | Enable/Disable minute in timePicker object | | timePicker.minute.step | int | null | The amount that increases or decreases minute, by pressing the button. overwrite by timepicker.step | | timePicker.second | object | | | | timePicker.second.enabled | boolean | true | Enable/Disable second in timePicker object | | timePicker.second.step | int | null | The amount that increases or decreases second, by pressing the button. overwrite by timepicker.step| | timePicker.meridian | object | | | | timePicker.meridian.enabled | boolean | true | Enable/Disable meridian in timePicker object | | dayPicker | object | | | | dayPicker.enabled | boolean | true | Enable/Disable dayPicker object | | dayPicker.titleFormat | string | 'YYYY MMMM' | DayPicker title format string | | dayPicker.titleFormatter | function | function (year, month) {} | DayPicker title formatter function | | dayPicker.onSelect | event | function (selectedDayUnix) {} | Called when date select by user | | monthPicker | object | | | | monthPicker.enabled | boolean | true | Enable/Disable monthPicker object | | monthPicker.titleFormat | string | 'YYYY' | MonthPicker title format string | | monthPicker.titleFormatter | function | function (unix) {} | MonthPicker title formatter function | | monthPicker.onSelect | event | function (monthIndex) {} | Called when month select by user | | yearPicker | object | | | | yearPicker.enabled | boolean | true | Enable/Disable yearPicker object | | yearPicker.titleFormat | string | 'YYYY' | YearPicker title format string | | yearPicker.titleFormatter | function | function (year) {} | YearPicker title formatter function | | yearPicker.onSelect | event | function (year) {} | Called when year select by user | | onSelect | event | function (unixDate) {} | Called when date Select by user. | | onSet | event | function (unixDate) {} | Called when date Select by api. | | onShow | event | function () {} | Called when datePicker shown | | onHide | event | function () {} | Called when datePicker hidden | | onToggle | event | function () {} | Called when datePicker visibility toggle | | onDestroy | event | function () {} | Called when datePicker destroyed | | autoClose | boolean | false | If true datePicker close after select date| | position | string | 'auto' | Position of datepicker element relative to input element, accept 'auto', [x,y] | | observer | boolean | false | If true datepicker update self by user inputted date string, accept 'yyyy/mm/dd' | | inputDelay | int | 800 (millisecond) | Time for last user key-down event, accept millisecond | | template | string | null | By default datepicker have a template string, and you can overwrite it simply by replace string in config. |

license

Freely distributable under the terms of the MIT license.