MCPcopy Index your code
hub / github.com/babakhani/pwt.datepicker

github.com/babakhani/pwt.datepicker @v1.2.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.2.0 ↗ · + Follow
104 symbols 220 edges 19 files 67 documented · 64% updated 15mo agov1.2.0 · 2019-08-10★ 63541 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
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="https://github.com/babakhani/pwt.datepicker/raw/v1.2.0/css/persian.datepicker.css"/>
  <script src="https://github.com/babakhani/pwt.datepicker/raw/v1.2.0/js/jquery.js"></script>
  <script src="https://github.com/babakhani/pwt.datepicker/raw/v1.2.0/js/persian.date.js"></script>
  <script src="https://github.com/babakhani/pwt.datepicker/raw/v1.2.0/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

Core symbols most depended-on inside this repo

Shape

Method 73
Class 20
Function 11

Languages

TypeScript100%

Modules by API surface

src/es6/view.js28 symbols
src/es6/input.js15 symbols
src/es6/state.js12 symbols
src/es6/api.js10 symbols
src/es6/navigator.js7 symbols
src/es6/toolbox.js5 symbols
src/es6/helper.js5 symbols
assets/persian-date.min.js5 symbols
src/es6/persian-date-wrapper.js4 symbols
src/es6/parser.js4 symbols
src/es6/options.js4 symbols
src/es6/model.js4 symbols

For agents

$ claude mcp add pwt.datepicker \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page