Skip to content

Commit

Permalink
add v1.2.3 description in Readme, add ids in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
t1m0n committed Feb 13, 2016
1 parent 9e96585 commit cbe7325
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 26 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Air Datepicker

Lightweight customizable cross-browser jQuery datepicker, built with es5 and css-flexbox. Works in all modern browsers.
Lightweight customizable cross-browser jQuery datepicker, built with es5 and css-flexbox. Works in all modern desktop and mobile browsers (tested no Android 4.4+ and iOS8+)
![air datepicker image](https://github.com/t1m0n/air-datepicker/raw/master/docs/img/promo-img.png)

## Install
Expand All @@ -19,6 +19,10 @@ $('.my-datepicker').datepicker([options])

## Change log

### v1.2.3
* fixed `dateFormat` method.
* fixed typo in Russian docs, add ids in docs headers.

### v1.2.2
* fixed typo in `monthsField`
* added German language (thanks to [Ichag](https://github.com/Ichag))
Expand Down
13 changes: 6 additions & 7 deletions docs/index-ru.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@

// Доступ к экземпляру объекта
$('#my-element').data('datepicker')
</code></pre></article><article><h2 id="examples">Примеры</h2><h3>Инициализация с опциями по умолчанию</h3><div class="example"><div class="example--label">Пример</div><div class="example-content"><input type="text" class="datepicker-here"></div><pre class="example-code"><code class="html">&lt;input type='text' class='datepicker-here' /&gt;
</code></pre></div><h3>Выбор нескольких дат</h3><p>Передайте параметр<span class="example-inline"><code class="js">{multipleDates: true}</code></span>для выбора нескольких дат. Если требуется ограничить количество выбранных дат, то передайте необходимое число<span class="example-inline"><code class="js">{multipleDates: 3}</code></span>.</p><div class="example"><div class="example--label">Пример</div><div class="example-content"><input type="text" data-multiple-dates="3" data-multiple-dates-separator=", " data-position="top left" class="datepicker-here"></div><pre class="example-code"><code class="html">&lt;input type=&quot;text&quot;
</code></pre></article><article><h2 id="examples">Примеры</h2><h3 id="example-default">Инициализация с опциями по умолчанию</h3><div class="example"><div class="example--label">Пример</div><div class="example-content"><input type="text" class="datepicker-here"></div><pre class="example-code"><code class="html">&lt;input type='text' class='datepicker-here' /&gt;
</code></pre></div><h3 id="example-multiple">Выбор нескольких дат</h3><p>Передайте параметр<span class="example-inline"><code class="js">{multipleDates: true}</code></span>для выбора нескольких дат. Если требуется ограничить количество выбранных дат, то передайте необходимое число<span class="example-inline"><code class="js">{multipleDates: 3}</code></span>.</p><div class="example"><div class="example--label">Пример</div><div class="example-content"><input type="text" data-multiple-dates="3" data-multiple-dates-separator=", " data-position="top left" class="datepicker-here"></div><pre class="example-code"><code class="html">&lt;input type=&quot;text&quot;
class=&quot;datepicker-here&quot;
data-multiple-dates=&quot;3&quot;
data-multiple-dates-separator=&quot;, &quot;
data-position='right top'/&gt;
</code></pre></div><h3>Постоянно видимый календарь</h3><p>Проинициализируйте плагин на элементе, который не является текстовым полем, например на<span class="example-inline"><code class="html">&lt;div&gt; … &lt;/div&gt;</code></span>, либо передайте параметр<span class="example-inline"><code class="js">{inline: true}</code></span>.</p><div class="example"><div class="example--label">Пример</div><div class="example-content"><div class="datepicker-here"></div></div><pre class="example-code"><code class="html">&lt;div class=&quot;datepicker-here&quot;&gt;&lt;/div&gt;
</code></pre></div><h3>Выбор месяца</h3><div class="example"><div class="example--label">Пример</div><div class="example-content"><input type="text" data-min-view="months" data-view="months" data-date-format="MM yyyy" class="datepicker-here"></div><pre class="example-code"><code class="html">&lt;input type=&quot;text&quot;
</code></pre></div><h3 id="example-inline">Постоянно видимый календарь</h3><p>Проинициализируйте плагин на элементе, который не является текстовым полем, например на<span class="example-inline"><code class="html">&lt;div&gt; … &lt;/div&gt;</code></span>, либо передайте параметр<span class="example-inline"><code class="js">{inline: true}</code></span>.</p><div class="example"><div class="example--label">Пример</div><div class="example-content"><div class="datepicker-here"></div></div><pre class="example-code"><code class="html">&lt;div class=&quot;datepicker-here&quot;&gt;&lt;/div&gt;
</code></pre></div><h3 id="example-months">Выбор месяца</h3><div class="example"><div class="example--label">Пример</div><div class="example-content"><input type="text" data-min-view="months" data-view="months" data-date-format="MM yyyy" class="datepicker-here"></div><pre class="example-code"><code class="html">&lt;input type=&quot;text&quot;
class=&quot;datepicker-here&quot;
data-min-view=&quot;months&quot;
data-view=&quot;months&quot;
data-date-format=&quot;MM yyyy&quot; /&gt;
</code></pre></div><h3>Минимальная и максимальные даты</h3><p>Чтобы ограничить выбор даты, используйте<span class="example-inline"><code class="js">minDate</code></span>и<span class="example-inline"><code class="js">maxDate</code></span>, которым нужно передать объект даты.</p><div class="example"><div class="example--label">Пример</div><div class="example-content"><input id="minMaxExample" type="text"><script>$('#minMaxExample').datepicker({
</code></pre></div><h3 id="example-min-max">Минимальная и максимальные даты</h3><p>Чтобы ограничить выбор даты, используйте<span class="example-inline"><code class="js">minDate</code></span>и<span class="example-inline"><code class="js">maxDate</code></span>, которым нужно передать объект даты.</p><div class="example"><div class="example--label">Пример</div><div class="example-content"><input id="minMaxExample" type="text"><script>$('#minMaxExample').datepicker({
// Можно выбрать тольо даты, идущие за сегодняшним днем, включая сегодня.
minDate: new Date()
})</script></div><pre class="example-code"><code class="js">$('#minMaxExample').datepicker({
Expand Down Expand Up @@ -58,7 +58,7 @@
}
}
})
</code></pre></div><h3>Кастомное содержимое ячеек</h3><p>Air Datepicker позволяет менять содержимое ячеек как угодно. Для этого можно также воспользоваться методом<span class="example-inline"><code>onRenderCell</code></span>.
</code></pre></div><h3 id="example-custom-content">Кастомное содержимое ячеек</h3><p>Air Datepicker позволяет менять содержимое ячеек как угодно. Для этого можно также воспользоваться методом<span class="example-inline"><code>onRenderCell</code></span>.
Давайте добавим вспомогательные элементы к нескольким датам и покажем случайный текст при выборе этих дат:</p><div class="example"><div class="example--label">Пример</div><div class="example-content"><div class="list-inline"><div><div id="custom-cells"></div></div><div id="custom-cells-events"><strong></strong><p></p></div></div><script>var eventDates = [1, 10, 12, 22],
$picker = $('#custom-cells'),
$content = $('#custom-cells-events'),
Expand Down Expand Up @@ -125,7 +125,6 @@
// Сразу выберем какую-ниудь дату из `eventDates`
var currentDate = currentDate = new Date();
$picker.data('datepicker').selectDate(new Date(currentDate.getFullYear(), currentDate.getMonth(), 10))

</code></pre></div></article><article><h2 id="localization">Локализация</h2><p>Вы можете добавить свою локализацию в объект<span class="example-inline"><code class="js">Datepicker.language[&quot;my-lang&quot;]</code></span>и при вызове календаря передать название языка в параметр<span class="example-inline"><code class="js">language</code></span></p><pre class="example-code"><code class="js">Datepicker.language['my-lang'] = {...}

$('.my-datepicker').datepicker({
Expand Down
8 changes: 4 additions & 4 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@
&lt;/html&gt;</code></pre><p>Datepicker will automatically initialize on elements with class<span class="example-inline"><code class="css">.datepicker-here</code></span>, options may be sent via<span class="example-inline"><code class="html">data</code></span>attributes.</p><pre class="example-code"><code class="html">&lt;input type='text' class=&quot;datepicker-here&quot; data-position=&quot;right top&quot; /&gt;</code></pre><h3>Manual initialization</h3><pre class="example-code"><code class="js">// Initialization
$('#my-element').datepicker([options])
// Access instance of plugin
$('#my-element').data('datepicker')</code></pre></article><article><h2 id="examples">Examples</h2><h3>Initialization with default options</h3><div class="example"><div class="example--label">Example</div><div class="example-content"><input type="text" data-language="en" class="datepicker-here"></div><pre class="example-code"><code class="html">&lt;input type='text' class='datepicker-here' data-language='en' /&gt;</code></pre></div><h3>Selecting multiple dates</h3><p>Pass parameter<span class="example-inline"><code class="js">{multipleDates: true}</code></span>for selection of multiple dates. If you want to limit the number of selected dates, pass the desired number<span class="example-inline"><code class="js">{multipleDates: 3}</code></span>.</p><div class="example"><div class="example--label">Example</div><div class="example-content"><input type="text" data-multiple-dates="3" data-multiple-dates-separator=", " data-position="top left" data-language="en" class="datepicker-here"></div><pre class="example-code"><code class="html">&lt;input type=&quot;text&quot;
$('#my-element').data('datepicker')</code></pre></article><article><h2 id="examples">Examples</h2><h3 id="example-default">Initialization with default options</h3><div class="example"><div class="example--label">Example</div><div class="example-content"><input type="text" data-language="en" class="datepicker-here"></div><pre class="example-code"><code class="html">&lt;input type='text' class='datepicker-here' data-language='en' /&gt;</code></pre></div><h3 id="example-multiple">Selecting multiple dates</h3><p>Pass parameter<span class="example-inline"><code class="js">{multipleDates: true}</code></span>for selection of multiple dates. If you want to limit the number of selected dates, pass the desired number<span class="example-inline"><code class="js">{multipleDates: 3}</code></span>.</p><div class="example"><div class="example--label">Example</div><div class="example-content"><input type="text" data-multiple-dates="3" data-multiple-dates-separator=", " data-position="top left" data-language="en" class="datepicker-here"></div><pre class="example-code"><code class="html">&lt;input type=&quot;text&quot;
class=&quot;datepicker-here&quot;
data-language='en'
data-multiple-dates=&quot;3&quot;
data-multiple-dates-separator=&quot;, &quot;
data-position='top left'/&gt;</code></pre></div><h3>Permanently visible calendar</h3><p>Initialize plugin on non text input element, such as<span class="example-inline"><code class="html">&lt;div&gt; … &lt;/div&gt;</code></span>,or pass the parameter<span class="example-inline"><code class="js">{inline: true}</code></span>.</p><div class="example"><div class="example--label">Example</div><div class="example-content"><div data-language="en" class="datepicker-here"></div></div><pre class="example-code"><code class="html">&lt;div class=&quot;datepicker-here&quot; data-language='en'&gt;&lt;/div&gt;</code></pre></div><h3>Month selection</h3><div class="example"><div class="example--label">Example</div><div class="example-content"><input type="text" data-min-view="months" data-view="months" data-date-format="MM yyyy" data-language="en" class="datepicker-here"></div><pre class="example-code"><code class="html">&lt;input type=&quot;text&quot;
data-position='top left'/&gt;</code></pre></div><h3 id="example-inline">Permanently visible calendar</h3><p>Initialize plugin on non text input element, such as<span class="example-inline"><code class="html">&lt;div&gt; … &lt;/div&gt;</code></span>,or pass the parameter<span class="example-inline"><code class="js">{inline: true}</code></span>.</p><div class="example"><div class="example--label">Example</div><div class="example-content"><div data-language="en" class="datepicker-here"></div></div><pre class="example-code"><code class="html">&lt;div class=&quot;datepicker-here&quot; data-language='en'&gt;&lt;/div&gt;</code></pre></div><h3 id="example-months">Month selection</h3><div class="example"><div class="example--label">Example</div><div class="example-content"><input type="text" data-min-view="months" data-view="months" data-date-format="MM yyyy" data-language="en" class="datepicker-here"></div><pre class="example-code"><code class="html">&lt;input type=&quot;text&quot;
class=&quot;datepicker-here&quot;
data-language='en'
data-min-view=&quot;months&quot;
data-view=&quot;months&quot;
data-date-format=&quot;MM yyyy&quot; /&gt;</code></pre></div><h3>Minimum and maximum dates</h3><p>To limit date selection, use<span class="example-inline"><code class="js">minDate</code></span>and<span class="example-inline"><code class="js">maxDate</code></span>, they must receive JavaScript Date object.</p><div class="example"><div class="example--label">Example</div><div class="example-content"><input id="minMaxExample" type="text"><script>$('#minMaxExample').datepicker({
data-date-format=&quot;MM yyyy&quot; /&gt;</code></pre></div><h3 id="example-min-max">Minimum and maximum dates</h3><p>To limit date selection, use<span class="example-inline"><code class="js">minDate</code></span>and<span class="example-inline"><code class="js">maxDate</code></span>, they must receive JavaScript Date object.</p><div class="example"><div class="example--label">Example</div><div class="example-content"><input id="minMaxExample" type="text"><script>$('#minMaxExample').datepicker({
language: 'en',
minDate: new Date() // Now can select only dates, which goes after today
})</script></div><pre class="example-code"><code class="js">$('#minMaxExample').datepicker({
Expand Down Expand Up @@ -66,7 +66,7 @@
}
}
})
</code></pre></div><h3>Custom cells content</h3><p>Air Datepicker allows you to change contents of cells like you want. You could use<span class="example-inline"><code>onRenderCell</code></span>for this purpose.
</code></pre></div><h3 id="example-custom-content">Custom cells content</h3><p>Air Datepicker allows you to change contents of cells like you want. You could use<span class="example-inline"><code>onRenderCell</code></span>for this purpose.
Lets add extra elements to several dates, and show `lorem` text when selecting them.</p><div class="example"><div class="example--label">Example</div><div class="example-content"><div class="list-inline"><div><div id="custom-cells"></div></div><div id="custom-cells-events"><strong></strong><p></p></div></div><script>var eventDates = [1, 10, 12, 22],
$picker = $('#custom-cells'),
$content = $('#custom-cells-events'),
Expand Down
15 changes: 7 additions & 8 deletions docs/jade/pages/index-ru.jade
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ block content

article
h2#examples Примеры
h3 Инициализация с опциями по умолчанию
h3#example-default Инициализация с опциями по умолчанию
+example
+example-content
input(type='text').datepicker-here
+example-code('html')
:code
<input type='text' class='datepicker-here' />

h3 Выбор нескольких дат
h3#example-multiple Выбор нескольких дат
p
| Передайте параметр
+example-inline('{multipleDates: true}','js')
Expand All @@ -89,7 +89,7 @@ block content
data-multiple-dates-separator=", "
data-position='right top'/>

h3 Постоянно видимый календарь
h3#example-inline Постоянно видимый календарь
p
| Проинициализируйте плагин на элементе, который не является текстовым полем, например на
+example-inline('<div> … </div>', 'html')
Expand All @@ -103,7 +103,7 @@ block content
:code
<div class="datepicker-here"></div>

h3 Выбор месяца
h3#example-months Выбор месяца
+example
+example-content
input.datepicker-here(type='text' data-min-view='months' data-view='months' data-date-format='MM yyyy')
Expand All @@ -115,7 +115,7 @@ block content
data-view="months"
data-date-format="MM yyyy" />

h3 Минимальная и максимальные даты
h3#example-min-max Минимальная и максимальные даты
p
| Чтобы ограничить выбор даты, используйте
+example-inline('minDate', 'js')
Expand All @@ -137,7 +137,7 @@ block content
})

h3#example-range Диапозон дат
p Используйте параметр
p Используйте парамтер
+example-inline('{range: true}')
| для выбора диапазона. В качестве разделителя дат будет использован
+example-inline('multipleDatesSeparator')
Expand Down Expand Up @@ -191,7 +191,7 @@ block content
}
})

h3 Кастомное содержимое ячеек
h3#example-custom-content Кастомное содержимое ячеек
p Air Datepicker позволяет менять содержимое ячеек как угодно. Для этого можно также воспользоваться методом
+example-inline('onRenderCell')
| .
Expand Down Expand Up @@ -277,7 +277,6 @@ block content
var currentDate = currentDate = new Date();
$picker.data('datepicker').selectDate(new Date(currentDate.getFullYear(), currentDate.getMonth(), 10))


article
h2#localization Локализация
p
Expand Down
Loading

0 comments on commit cbe7325

Please sign in to comment.