mirror of
https://github.com/frappe/air-datepicker.git
synced 2026-01-14 11:01:22 +08:00
update docs and readme
This commit is contained in:
parent
6a6bab2960
commit
3556014fba
12
README.md
12
README.md
@ -4,7 +4,7 @@ Lightweight cross-browser jQuery datepicker, built with es5 and css-flexbox. Wor
|
||||
|
||||
## Install
|
||||
```
|
||||
bower i --save-dev air-datepicker
|
||||
bower i --save air-datepicker
|
||||
```
|
||||
|
||||
## Usage
|
||||
@ -14,4 +14,12 @@ $('.my-datepicker').datepicker([options])
|
||||
|
||||
## Demo and docs
|
||||
* [In English](http://t1m0n.name/air-datepicker/docs/)
|
||||
* [In Russian](http://t1m0n.name/air-datepicker/docs/index-ru.html)
|
||||
* [In Russian](http://t1m0n.name/air-datepicker/docs/index-ru.html)
|
||||
|
||||
## Change log
|
||||
|
||||
### v.1.1.0
|
||||
* add keyboard navigation
|
||||
* add `classes` option to add custom classes
|
||||
* add `altField` option
|
||||
* bug fixes
|
||||
|
||||
2
dist/js/datepicker.js
vendored
2
dist/js/datepicker.js
vendored
@ -22,6 +22,7 @@ var Datepicker;
|
||||
altField: '',
|
||||
altFieldDateFormat: '@',
|
||||
toggleSelected: true,
|
||||
keyboardNav: true,
|
||||
|
||||
position: 'bottom left',
|
||||
offset: 12,
|
||||
@ -59,7 +60,6 @@ var Datepicker;
|
||||
months: 'yyyy',
|
||||
years: 'yyyy1 - yyyy2'
|
||||
},
|
||||
keyboardNav: true,
|
||||
|
||||
// events
|
||||
onSelect: '',
|
||||
|
||||
2
dist/js/datepicker.min.js
vendored
2
dist/js/datepicker.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,5 +1,5 @@
|
||||
mixin param(content, type)
|
||||
span.param-inline
|
||||
strong= content
|
||||
strong !{content}
|
||||
if type
|
||||
i= type
|
||||
|
||||
@ -66,7 +66,7 @@ block content
|
||||
h3 Инициализация с опциями по умолчанию
|
||||
+example
|
||||
+example-content
|
||||
input(type='text' readonly)#test.datepicker-here
|
||||
input(type='text').datepicker-here
|
||||
+example-code('html')
|
||||
:code
|
||||
<input type='text' class='datepicker-here' />
|
||||
@ -229,6 +229,10 @@ block content
|
||||
article
|
||||
h2#options Опции
|
||||
|
||||
.param
|
||||
+param-header('classes', 'string', '""')
|
||||
p Дополнительные классы для календаря.
|
||||
|
||||
.param
|
||||
+param-header('inline', 'boolean', 'false')
|
||||
p Если true, то календарь будет виден постоянно.
|
||||
@ -262,6 +266,9 @@ block content
|
||||
+param-header('dateFormat', 'string', '""')
|
||||
p Желаемый формат даты, кобминация из d, m, yyyy, D, M, и т.д. По умолчанию берется из локализации, если передать значение сюда, то оно будет иметь больший приоритет.
|
||||
ul
|
||||
li
|
||||
+param('@')
|
||||
| - время в миллесекундах
|
||||
li
|
||||
+param('d')
|
||||
| - дата
|
||||
@ -299,10 +306,50 @@ block content
|
||||
+param('yyyy2')
|
||||
| - последний год декады, в которую входит текущий год
|
||||
|
||||
.param
|
||||
+param-header('altField', 'string|jQuery', '""')
|
||||
p Альтернативное поле воода в значение которого будут попадать выбранные даты с форматом
|
||||
+example-inline('altFieldDateFormat')
|
||||
|.
|
||||
|
||||
.param
|
||||
+param-header('altFieldDateFormat', 'string', '"@"')
|
||||
p Формат даты для альтернативного поля.
|
||||
|
||||
.param
|
||||
+param-header('toggleSelected', 'boolean', 'true')
|
||||
p Если true, то клик на выделенной дате снимет выделение.
|
||||
|
||||
.param
|
||||
+param-header('keyboardNav', 'boolean', 'true')
|
||||
p Если true, то по календарю можно будет осуществлять навигацию с помощью клавиатуры.
|
||||
p Сочетания клавиш:
|
||||
ul
|
||||
li
|
||||
+param('Ctrl + → | ↑')
|
||||
| - переход на месяц вперед
|
||||
li
|
||||
+param('Ctrl + ← | ↓')
|
||||
| - переход на месяц назад
|
||||
li
|
||||
+param('Shift + → | ↑')
|
||||
| - переход на год вперед
|
||||
li
|
||||
+param('Shift + ← | ↓')
|
||||
| - переход на год назад
|
||||
li
|
||||
+param('Alt + → | ↑')
|
||||
| - переход на 10 лет вперед
|
||||
li
|
||||
+param('Alt + ← | ↓')
|
||||
| - переход на 10 лет назад
|
||||
li
|
||||
+param('Ctrl + Shift + ↑ | ↓')
|
||||
| - переход на следующий вид
|
||||
li
|
||||
+param('Esc')
|
||||
| - закрывает календарь
|
||||
|
||||
.param
|
||||
+param-header('position', 'string', '"bottom left"')
|
||||
p
|
||||
|
||||
@ -215,6 +215,10 @@ block content
|
||||
| directory.
|
||||
article
|
||||
h2#options Options
|
||||
.param
|
||||
+param-header('classes', 'string', '""')
|
||||
p Extra css classes for datepicker.
|
||||
|
||||
.param
|
||||
+param-header('inline', 'boolean', 'false')
|
||||
p If true, then datepicker will be always visible.
|
||||
@ -245,6 +249,9 @@ block content
|
||||
+param-header('dateFormat', 'string', '""')
|
||||
p Desirable date format. It's combination of d, m, yyyy, D, M, etc. By default value is taken from current localization, but if it passed here, then it will have higher priority.
|
||||
ul
|
||||
li
|
||||
+param('@')
|
||||
| - time in milliseconds
|
||||
li
|
||||
+param('d')
|
||||
| - date number
|
||||
@ -281,9 +288,49 @@ block content
|
||||
li
|
||||
+param('yyyy2')
|
||||
| - last year of decade, which included current year
|
||||
.param
|
||||
+param-header('altField', 'string|jQuery', '""')
|
||||
p Alternative text input. Use
|
||||
+example-inline('altFieldDateFormat')
|
||||
| for date formatting.
|
||||
.param
|
||||
+param-header('altFieldDateFormat', 'string', '"@"')
|
||||
p Date format for alternative field.
|
||||
|
||||
.param
|
||||
+param-header('toggleSelected', 'boolean', 'true')
|
||||
p If true, then clicking on selected cell will remove selection.
|
||||
|
||||
.param
|
||||
+param-header('keyboardNav', 'boolean', 'true')
|
||||
p If true, then one can navigate through calendar by keyboard.
|
||||
p Hot keys:
|
||||
ul
|
||||
li
|
||||
+param('Ctrl + → | ↑')
|
||||
| - move one month forwards
|
||||
li
|
||||
+param('Ctrl + ← | ↓')
|
||||
| - move one month backwards
|
||||
li
|
||||
+param('Shift + → | ↑')
|
||||
| - move one year forwards
|
||||
li
|
||||
+param('Shift + ← | ↓')
|
||||
| - move one year backwards
|
||||
li
|
||||
+param('Alt + → | ↑')
|
||||
| - move 10 years forwards
|
||||
li
|
||||
+param('Alt + ← | ↓')
|
||||
| - move 10 years backwards
|
||||
li
|
||||
+param('Ctrl + Shift + ↑ | ↓')
|
||||
| - move to next view
|
||||
li
|
||||
+param('Esc')
|
||||
| - hides datepicker
|
||||
|
||||
.param
|
||||
+param-header('position', 'string', '"bottom left"')
|
||||
p
|
||||
@ -358,7 +405,7 @@ block content
|
||||
p Event type, on which datepicker should be shown.
|
||||
.param
|
||||
+param-header('autoClose', 'boolean', 'false')
|
||||
p If true, when after date selection, datepicker will be closed.
|
||||
p If true, then after date selection, datepicker will be closed.
|
||||
.param
|
||||
+param-header('prevHtml', 'string', '<svg><path d="M 17,12 l -5,5 l 5,5"></path></svg>')
|
||||
p Contents of 'next' button.
|
||||
@ -453,7 +500,7 @@ block content
|
||||
{
|
||||
html: '', // Custom cell content
|
||||
classes: '', // Extra css classes to cell
|
||||
disabled: '' // true/false, if true, when cell will be disabled
|
||||
disabled: '' // true/false, if true, then cell will be disabled
|
||||
}
|
||||
h4 Example
|
||||
+example-code('js').
|
||||
|
||||
@ -22,6 +22,7 @@ var Datepicker;
|
||||
altField: '',
|
||||
altFieldDateFormat: '@',
|
||||
toggleSelected: true,
|
||||
keyboardNav: true,
|
||||
|
||||
position: 'bottom left',
|
||||
offset: 12,
|
||||
@ -59,7 +60,6 @@ var Datepicker;
|
||||
months: 'yyyy',
|
||||
years: 'yyyy1 - yyyy2'
|
||||
},
|
||||
keyboardNav: true,
|
||||
|
||||
// events
|
||||
onSelect: '',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user