mirror of
https://github.com/xdan/datetimepicker.git
synced 2024-11-18 06:24:22 +00:00
Merge pull request #634 from xdan/master
Show 2 months in calendar at the same time
This commit is contained in:
commit
5bc1822c50
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,3 +0,0 @@
|
||||
parse.php
|
||||
bower_components
|
||||
node_modules
|
18
README.md
18
README.md
@ -2,6 +2,14 @@
|
||||
[Doc.tpl](https://github.com/xdan/datetimepicker/blob/master/doc.tpl)
|
||||
This file will be automatically displayed on the site
|
||||
|
||||
# Installation
|
||||
|
||||
```
|
||||
npm install jquery-datetimepicker
|
||||
OR
|
||||
yarn add jquery-datetimepicker
|
||||
```
|
||||
|
||||
# datetimepicker
|
||||
==============
|
||||
|
||||
@ -9,7 +17,7 @@ This file will be automatically displayed on the site
|
||||
|
||||
Use this:
|
||||
```javascript
|
||||
$.datetimepicker.setLocale('en');
|
||||
jQuery.datetimepicker.setLocale('en');
|
||||
```
|
||||
[Documentation][doc]
|
||||
|
||||
@ -47,6 +55,12 @@ Install:
|
||||
2. Run `npm install`. npm will look at `package.json` and automatically install the necessary dependencies.
|
||||
3. Run `bower install`, which installs front-end packages defined in `bower.json`.
|
||||
|
||||
Notice: If you use Bower v1.5.2, you will get error: `The "main" field cannot contain minified files`
|
||||
You can regress to version 1.3.12
|
||||
|
||||
1. `npm uninstall bower -g`
|
||||
2. `npm install -g bower@1.3.12`
|
||||
|
||||
Build:
|
||||
|
||||
- `npm run build`
|
||||
@ -54,4 +68,4 @@ Build:
|
||||
When build completed, you'll have the following files:
|
||||
- **build/jquery.datetimepicker.full.js** - browser file
|
||||
- **build/jquery.datetimepicker.full.min.js** - browser minified file
|
||||
- **build/jquery.datetimepicker.min.js** - amd module style minified file
|
||||
- **build/jquery.datetimepicker.min.js** - amd module style minified file
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "datetimepicker",
|
||||
"version": "2.5.3",
|
||||
"version": "2.5.11",
|
||||
"main": [
|
||||
"build/jquery.datetimepicker.full.min.js",
|
||||
"jquery.datetimepicker.css"
|
||||
|
File diff suppressed because one or more lines are too long
3
build/jquery.datetimepicker.full.min.js
vendored
3
build/jquery.datetimepicker.full.min.js
vendored
File diff suppressed because one or more lines are too long
2
build/jquery.datetimepicker.min.css
vendored
2
build/jquery.datetimepicker.min.css
vendored
File diff suppressed because one or more lines are too long
2
build/jquery.datetimepicker.min.js
vendored
2
build/jquery.datetimepicker.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "datetimepicker",
|
||||
"version": "2.5.3",
|
||||
"version": "2.5.4",
|
||||
"title": "jQuery Date and Time picker",
|
||||
"description": "jQuery plugin for date, time, or datetime manipulation in form",
|
||||
"keywords": [
|
||||
|
126
doc.tpl
126
doc.tpl
@ -39,7 +39,7 @@ jQuery('#datetimepicker_dark').datetimepicker({
|
||||
[include scripts/pp/reklama1.php]
|
||||
<h2>How do I use it?</h2>
|
||||
<p>First include to page css and js files</p>
|
||||
<pre><code data-language="html"><!-- this should go after your </body> -->
|
||||
<pre><code class="language-html"><!-- this should go after your </body> -->
|
||||
<link rel="stylesheet" type="text/css" href="jquery.datetimepicker.css"/ >
|
||||
<script src="jquery.js"></script>
|
||||
<script src="build/jquery.datetimepicker.full.min.js"></script></code></pre>
|
||||
@ -47,9 +47,9 @@ jQuery('#datetimepicker_dark').datetimepicker({
|
||||
<hr id="Simple" />
|
||||
<h4>Simple init DateTimePicker Example <a href="#Simple">#</a></h4>
|
||||
<p>HTML</p>
|
||||
<pre><code data-language="html"><input id="datetimepicker" type="text" ></code></pre>
|
||||
<pre><code class="language-html"><input id="datetimepicker" type="text" ></code></pre>
|
||||
<p><strong>javaScript</strong></p>
|
||||
<pre><code data-language="javascript">jQuery('#datetimepicker').datetimepicker();</code></pre>
|
||||
<pre><code class="language-javascript">jQuery('#datetimepicker').datetimepicker();</code></pre>
|
||||
<p><strong>Result</strong></p>
|
||||
<p><input id="_datetimepicker" type="text" value="2014/03/15 05:06" /></p>
|
||||
<script type="text/javascript">// <![CDATA[
|
||||
@ -59,7 +59,7 @@ jQuery(function(){jQuery('#_datetimepicker').datetimepicker();});
|
||||
<h4>i18n DatePicker Example <a href="#i18n">#</a></h4>
|
||||
<p>All supported languages <a href="#lang">here</a></p>
|
||||
<p><strong>javaScript</strong></p>
|
||||
<pre><code data-language="javascript">jQuery.datetimepicker.setLocale('de');
|
||||
<pre><code class="language-javascript">jQuery.datetimepicker.setLocale('de');
|
||||
|
||||
jQuery('#datetimepicker1').datetimepicker({
|
||||
i18n:{
|
||||
@ -98,7 +98,7 @@ format:'d.m.Y'
|
||||
<hr id="TimePicker" />
|
||||
<h4>Only TimePicker Example <a href="#TimePicker">#</a></h4>
|
||||
<p><strong>javaScript</strong></p>
|
||||
<pre><code data-language="javascript">jQuery('#datetimepicker2').datetimepicker({
|
||||
<pre><code class="language-javascript">jQuery('#datetimepicker2').datetimepicker({
|
||||
datepicker:false,
|
||||
format:'H:i'
|
||||
});</code></pre>
|
||||
@ -114,7 +114,7 @@ jQuery('#_datetimepicker2').datetimepicker({
|
||||
// ]]></script>
|
||||
<h3 id="startdateex">Date Time Picker start date <a href="#startdateex">#</a></h3>
|
||||
<p><strong>javaScript</strong></p>
|
||||
<pre><code data-language="javascript">jQuery('#datetimepicker_start_time').datetimepicker({
|
||||
<pre><code class="language-javascript">jQuery('#datetimepicker_start_time').datetimepicker({
|
||||
startDate:'+1971/05/01'//or 1986/12/08
|
||||
});</code></pre>
|
||||
<p><strong>Result</strong></p>
|
||||
@ -128,7 +128,7 @@ jQuery(function(){
|
||||
// ]]></script>
|
||||
<h3 id="unixtime">Date Time Picker from unixtime <a href="#unixtime">#</a></h3>
|
||||
<p><strong>javaScript</strong></p>
|
||||
<pre><code data-language="javascript">jQuery('#datetimepicker_unixtime').datetimepicker({
|
||||
<pre><code class="language-javascript">jQuery('#datetimepicker_unixtime').datetimepicker({
|
||||
format:'unixtime'
|
||||
});</code></pre>
|
||||
<p><strong>Result</strong></p>
|
||||
@ -143,7 +143,7 @@ jQuery(function(){
|
||||
<hr id="Inline" />
|
||||
<h4>Inline DateTimePicker Example <a href="#Inline">#</a></h4>
|
||||
<p><strong>javaScript</strong></p>
|
||||
<pre><code data-language="javascript">jQuery('#datetimepicker3').datetimepicker({
|
||||
<pre><code class="language-javascript">jQuery('#datetimepicker3').datetimepicker({
|
||||
format:'d.m.Y H:i',
|
||||
inline:true,
|
||||
lang:'ru'
|
||||
@ -163,12 +163,12 @@ jQuery('#_datetimepicker3').datetimepicker({
|
||||
<h4>Icon trigger <a href="#trigger">#</a></h4>
|
||||
<p>Click the icon next to the input field to show the datetimepicker</p>
|
||||
<p><strong>javaScript</strong></p>
|
||||
<pre><code data-language="javascript">jQuery('#datetimepicker4').datetimepicker({
|
||||
<pre><code class="language-javascript">jQuery('#datetimepicker4').datetimepicker({
|
||||
format:'d.m.Y H:i',
|
||||
lang:'ru'
|
||||
});</code></pre>
|
||||
<p>and handler onclick event</p>
|
||||
<pre><code data-language="javascript">jQuery('#image_button').click(function(){
|
||||
<pre><code class="language-javascript">jQuery('#image_button').click(function(){
|
||||
jQuery('#datetimepicker4').datetimepicker('show'); //support hide,show and destroy command
|
||||
});</code></pre>
|
||||
<p><strong>Result</strong></p>
|
||||
@ -192,7 +192,7 @@ jQuery('#image_button').click(function(){
|
||||
<hr id="allowTimes" />
|
||||
<h4>allowTimes options TimePicker Example <a href="#allowTimes">#</a></h4>
|
||||
<p><strong>javaScript</strong></p>
|
||||
<pre><code data-language="javascript">jQuery('#datetimepicker5').datetimepicker({
|
||||
<pre><code class="language-javascript">jQuery('#datetimepicker5').datetimepicker({
|
||||
datepicker:false,
|
||||
allowTimes:[
|
||||
'12:00', '13:00', '15:00',
|
||||
@ -212,7 +212,7 @@ jQuery('#_datetimepicker5').datetimepicker({
|
||||
<hr id="onChangeDateTime" />
|
||||
<h4>handler onChangeDateTime Example <a href="#onChangeDateTime">#</a></h4>
|
||||
<p><strong>javaScript</strong></p>
|
||||
<pre><code data-language="javascript">jQuery('#datetimepicker6').datetimepicker({
|
||||
<pre><code class="language-javascript">jQuery('#datetimepicker6').datetimepicker({
|
||||
timepicker:false,
|
||||
onChangeDateTime:function(dp,$input){
|
||||
alert($input.val())
|
||||
@ -233,7 +233,7 @@ jQuery('#_datetimepicker6').datetimepicker({
|
||||
<hr id="mindate" />
|
||||
<h4>minDate and maxDate Example <a href="#mindate">#</a></h4>
|
||||
<p><strong>javaScript</strong></p>
|
||||
<pre><code data-language="javascript">jQuery('#datetimepicker7').datetimepicker({
|
||||
<pre><code class="language-javascript">jQuery('#datetimepicker7').datetimepicker({
|
||||
timepicker:false,
|
||||
formatDate:'Y/m/d',
|
||||
minDate:'-1970/01/02',//yesterday is minimum date(for today use 0 or -1970/01/01)
|
||||
@ -254,7 +254,7 @@ jQuery('#_datetimepicker7').datetimepicker({
|
||||
<hr id="mask" />
|
||||
<h4>Use mask input Example <a href="#mask">#</a></h4>
|
||||
<p><strong>javaScript</strong></p>
|
||||
<pre><code data-language="javascript">jQuery('#datetimepicker_mask').datetimepicker({
|
||||
<pre><code class="language-javascript">jQuery('#datetimepicker_mask').datetimepicker({
|
||||
timepicker:false,
|
||||
mask:true, // '9999/19/39 29:59' - digit is the maximum possible for a cell
|
||||
});</code></pre>
|
||||
@ -273,7 +273,7 @@ jQuery('#_datetimepicker_mask').datetimepicker({
|
||||
<h4>Set options runtime DateTimePicker <a href="#runtime_options">#</a></h4>
|
||||
<p>If select day is Saturday, the minimum set 11:00, otherwise 8:00</p>
|
||||
<p><strong>javaScript</strong></p>
|
||||
<pre><code data-language="javascript">var logic = function( currentDateTime ){
|
||||
<pre><code class="language-javascript">var logic = function( currentDateTime ){
|
||||
// 'this' is jquery object datetimepicker
|
||||
if( currentDateTime.getDay()==6 ){
|
||||
this.setOptions({
|
||||
@ -312,7 +312,7 @@ jQuery('#_datetimepicker_runtime').datetimepicker({
|
||||
<h4>After generating a calendar called the event onGenerate <a href="#ongenerate">#</a></h4>
|
||||
<p>Invert settings minDate and maxDate</p>
|
||||
<p><strong>javaScript</strong></p>
|
||||
<pre><code data-language="javascript">jQuery('#datetimepicker8').datetimepicker({
|
||||
<pre><code class="language-javascript">jQuery('#datetimepicker8').datetimepicker({
|
||||
onGenerate:function( ct ){
|
||||
jQuery(this).find('.xdsoft_date')
|
||||
.toggleClass('xdsoft_disabled');
|
||||
@ -339,7 +339,7 @@ jQuery('#_datetimepicker_ongenerate').datetimepicker({
|
||||
<hr id="weekends_disable" />
|
||||
<h4>disable all weekend <a href="#weekends_disable">#</a></h4>
|
||||
<p><strong>javaScript</strong></p>
|
||||
<pre><code data-language="javascript">jQuery('#datetimepicker9').datetimepicker({
|
||||
<pre><code class="language-javascript">jQuery('#datetimepicker9').datetimepicker({
|
||||
onGenerate:function( ct ){
|
||||
jQuery(this).find('.xdsoft_date.xdsoft_weekend')
|
||||
.addClass('xdsoft_disabled');
|
||||
@ -364,7 +364,7 @@ jQuery('#_datetimepicker_weekends_disable').datetimepicker({
|
||||
<hr id="use_other_date_parser" />
|
||||
<h4>Use another date parser/formatter<a href="#use_other_date_parser">#</a></h4>
|
||||
<p>By default, datetimepicker uses <a href="https://github.com/kartik-v/php-date-formatter">php-date-formatter</a> for parsing and formatting the date and time displayed. You can replace the library by setting a custom DateFormatter. Simply supply an object that implements the <tt>parseDate</tt> and <tt>formatDate</tt> methods. This example uses the popular <a href="http://momentjs.com/">MomentJS</a> library:</p>
|
||||
<pre><code data-language="javascript">$.datetimepicker.setDateFormatter({
|
||||
<pre><code class="language-javascript">$.datetimepicker.setDateFormatter({
|
||||
parseDate: function (date, format) {
|
||||
var d = moment(date, format);
|
||||
return d.isValid() ? d.toDate() : false;
|
||||
@ -376,7 +376,7 @@ jQuery('#_datetimepicker_weekends_disable').datetimepicker({
|
||||
});
|
||||
</code></pre>
|
||||
<p>After this, you can init datetimepicker with moment.js <a href="http://momentjs.com/docs/#/parsing/string-format/" target="_blanc" rel="nofollow">format</a></p>
|
||||
<pre><code data-language="javascript">jQuery('#datetimepicker').datetimepicker({
|
||||
<pre><code class="language-javascript">jQuery('#datetimepicker').datetimepicker({
|
||||
format:'DD.MM.YYYY h:mm a',
|
||||
formatTime:'h:mm a',
|
||||
formatDate:'DD.MM.YYYY'
|
||||
@ -384,7 +384,7 @@ jQuery('#_datetimepicker_weekends_disable').datetimepicker({
|
||||
<hr id="range" />
|
||||
<h4>Range between date<a href="#range">#</a></h4>
|
||||
<p><strong>javaScript</strong></p>
|
||||
<pre><code data-language="javascript">jQuery(function(){
|
||||
<pre><code class="language-javascript">jQuery(function(){
|
||||
jQuery('#date_timepicker_start').datetimepicker({
|
||||
format:'Y/m/d',
|
||||
onShow:function( ct ){
|
||||
@ -447,7 +447,7 @@ jQuery(function(){
|
||||
<td>null</td>
|
||||
<td>Current value datetimepicker. If it is set, ignored input.value</td>
|
||||
<td>
|
||||
<pre><code data-language="javascript">{value:'12.03.2013',
|
||||
<pre><code class="language-javascript">{value:'12.03.2013',
|
||||
format:'d.m.Y'}</code></pre>
|
||||
</td>
|
||||
</tr>
|
||||
@ -512,7 +512,7 @@ jQuery(function(){
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<pre><code data-language="javascript">$.datetimepicker.setLocale('ru');</code></pre>
|
||||
<pre><code class="language-javascript">$.datetimepicker.setLocale('ru');</code></pre>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="format">
|
||||
@ -520,7 +520,7 @@ jQuery(function(){
|
||||
<td>Y/m/d H:i</td>
|
||||
<td>Format datetime. <a href="http://php.net/manual/ru/function.date.php" target="_blank">More</a> Also there is a special type of <a href="#unixtime"><em>«unixtime»</em></a></td>
|
||||
<td>
|
||||
<pre><code data-language="javascript">{format:'H'}
|
||||
<pre><code class="language-javascript">{format:'H'}
|
||||
{format:'Y'}{format:'unixtime'}</code></pre>
|
||||
</td>
|
||||
</tr>
|
||||
@ -529,7 +529,7 @@ jQuery(function(){
|
||||
<td>Y/m/d</td>
|
||||
<td>Format date for minDate and maxDate</td>
|
||||
<td>
|
||||
<pre><code data-language="javascript">{formatDate:'d.m.Y'}</code></pre>
|
||||
<pre><code class="language-javascript">{formatDate:'d.m.Y'}</code></pre>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="formatTime">
|
||||
@ -537,7 +537,7 @@ jQuery(function(){
|
||||
<td>H:i</td>
|
||||
<td> Similarly, formatDate . But for minTime and maxTime</td>
|
||||
<td>
|
||||
<pre><code data-language="javascript">{formatTime:'H'}</code></pre>
|
||||
<pre><code class="language-javascript">{formatTime:'H'}</code></pre>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="step">
|
||||
@ -545,7 +545,7 @@ jQuery(function(){
|
||||
<td>60</td>
|
||||
<td>Step time</td>
|
||||
<td>
|
||||
<pre><code data-language="javascript">{step:5}</code></pre>
|
||||
<pre><code class="language-javascript">{step:5}</code></pre>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="closeOnDateSelect">
|
||||
@ -553,7 +553,7 @@ jQuery(function(){
|
||||
<td>0</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<pre><code data-language="javascript">{closeOnDateSelect:true}</code></pre>
|
||||
<pre><code class="language-javascript">{closeOnDateSelect:true}</code></pre>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="closeOnWithoutClick">
|
||||
@ -561,7 +561,7 @@ jQuery(function(){
|
||||
<td>true</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<pre><code data-language="javascript">{ closeOnWithoutClick :false}</code></pre>
|
||||
<pre><code class="language-javascript">{ closeOnWithoutClick :false}</code></pre>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="validateOnBlur">
|
||||
@ -569,7 +569,7 @@ jQuery(function(){
|
||||
<td>true</td>
|
||||
<td>Verify datetime value from input, when losing focus. If value is not valid datetime, then to value inserts the current datetime</td>
|
||||
<td>
|
||||
<pre><code data-language="javascript">{ validateOnBlur:false}</code></pre>
|
||||
<pre><code class="language-javascript">{ validateOnBlur:false}</code></pre>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="timepicker">
|
||||
@ -577,7 +577,7 @@ jQuery(function(){
|
||||
<td>true</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<pre><code data-language="javascript">{timepicker:false}</code></pre>
|
||||
<pre><code class="language-javascript">{timepicker:false}</code></pre>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="datepicker">
|
||||
@ -585,7 +585,7 @@ jQuery(function(){
|
||||
<td>true</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<pre><code data-language="javascript">{datepicker:false}</code></pre>
|
||||
<pre><code class="language-javascript">{datepicker:false}</code></pre>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="weeks">
|
||||
@ -593,7 +593,7 @@ jQuery(function(){
|
||||
<td>false</td>
|
||||
<td>Show week number</td>
|
||||
<td>
|
||||
<pre><code data-language="javascript">{weeks:true}</code></pre>
|
||||
<pre><code class="language-javascript">{weeks:true}</code></pre>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="theme">
|
||||
@ -601,7 +601,7 @@ jQuery(function(){
|
||||
<td>'default'</td>
|
||||
<td>Setting a color scheme. Now only supported default and dark theme</td>
|
||||
<td>
|
||||
<pre><code data-language="javascript">{theme:'dark'}</code></pre>
|
||||
<pre><code class="language-javascript">{theme:'dark'}</code></pre>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="minDate">
|
||||
@ -609,7 +609,7 @@ jQuery(function(){
|
||||
<td>false</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<pre><code data-language="javascript">{minDate:0} // today
|
||||
<pre><code class="language-javascript">{minDate:0} // today
|
||||
{minDate:'2013/12/03'}
|
||||
{minDate:'-1970/01/02'} // yesterday
|
||||
{minDate:'05.12.2013',formatDate:'d.m.Y'}</code></pre>
|
||||
@ -620,7 +620,7 @@ jQuery(function(){
|
||||
<td>false</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<pre><code data-language="javascript">{maxDate:0}
|
||||
<pre><code class="language-javascript">{maxDate:0}
|
||||
{maxDate:'2013/12/03'}
|
||||
{maxDate:'+1970/01/02'} // tomorrow
|
||||
{maxDate:'05.12.2013',formatDate:'d.m.Y'}</code></pre>
|
||||
@ -631,7 +631,7 @@ jQuery(function(){
|
||||
<td>false</td>
|
||||
<td>calendar set date use starDate</td>
|
||||
<td>
|
||||
<pre><code data-language="javascript">{startDate:'1987/12/03'}
|
||||
<pre><code class="language-javascript">{startDate:'1987/12/03'}
|
||||
{startDate:new Date()}
|
||||
{startDate:'+1970/01/02'} // tomorrow
|
||||
{startDate:'08.12.1986',formatDate:'d.m.Y'}</code></pre>
|
||||
@ -643,7 +643,7 @@ jQuery(function(){
|
||||
<td>false</td>
|
||||
<td>if input value is empty, calendar set date use defaultDate</td>
|
||||
<td>
|
||||
<pre><code data-language="javascript">{defaultDate:'1987/12/03'}
|
||||
<pre><code class="language-javascript">{defaultDate:'1987/12/03'}
|
||||
{defaultDate:new Date()}
|
||||
{defaultDate:'+1970/01/02'} // tomorrow
|
||||
{defaultDate:'08.12.1986',formatDate:'d.m.Y'}</code></pre>
|
||||
@ -655,7 +655,7 @@ jQuery(function(){
|
||||
<td>false</td>
|
||||
<td>if input value is empty, timepicker set time use defaultTime</td>
|
||||
<td>
|
||||
<pre><code data-language="javascript">{defaultTime:'05:00'}
|
||||
<pre><code class="language-javascript">{defaultTime:'05:00'}
|
||||
{defaultTime:'33-12',formatTime:'i-H'}</code></pre>
|
||||
</td>
|
||||
</tr>
|
||||
@ -665,7 +665,7 @@ jQuery(function(){
|
||||
<td>false</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<pre><code data-language="javascript">{minTime:0,}// now
|
||||
<pre><code class="language-javascript">{minTime:0,}// now
|
||||
{minTime:new Date()}
|
||||
{minTime:'12:00'}
|
||||
{minTime:'13:45:34',formatTime:'H:i:s'}</code></pre>
|
||||
@ -676,7 +676,7 @@ jQuery(function(){
|
||||
<td>false</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<pre><code data-language="javascript">{maxTime:0,}
|
||||
<pre><code class="language-javascript">{maxTime:0,}
|
||||
{maxTime:'12:00'}
|
||||
{maxTime:'13:45:34',formatTime:'H:i:s'}</code></pre>
|
||||
</td>
|
||||
@ -686,7 +686,7 @@ jQuery(function(){
|
||||
<td>[]</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<pre><code data-language="javascript">{allowTimes:[
|
||||
<pre><code class="language-javascript">{allowTimes:[
|
||||
'09:00',
|
||||
'11:00',
|
||||
'12:00',
|
||||
@ -752,7 +752,7 @@ jQuery(function(){
|
||||
<td>function(){}</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<pre><code data-language="javascript">onSelectDate:function(ct,$i){
|
||||
<pre><code class="language-javascript">onSelectDate:function(ct,$i){
|
||||
alert(ct.dateFormat('d/m/Y'))
|
||||
}</code></pre>
|
||||
</td>
|
||||
@ -791,7 +791,7 @@ jQuery(function(){
|
||||
<td><a href="#onClose">onClose</a></td>
|
||||
<td>function(current_time,$input){}</td>
|
||||
<td> </td>
|
||||
<td><pre><code data-language="javascript">onSelectDate:function(ct,$i){
|
||||
<td><pre><code class="language-javascript">onSelectDate:function(ct,$i){
|
||||
$i.datetimepicker('destroy');
|
||||
}</code></pre></td>
|
||||
</tr>
|
||||
@ -854,7 +854,7 @@ jQuery(function(){
|
||||
<td>round</td>
|
||||
<td>Round time in timepicker, possible values: round, ceil, floor</td>
|
||||
<td>
|
||||
<pre><code data-language="javascript">{roundTime:'floor'}</code></pre>
|
||||
<pre><code class="language-javascript">{roundTime:'floor'}</code></pre>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="dayOfWeekStart">
|
||||
@ -877,7 +877,7 @@ jQuery(function(){
|
||||
<td>[]</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<pre><code data-language="javascript">['01.01.2014','02.01.2014','03.01.2014','04.01.2014','05.01.2014','06.01.2014']</code></pre>
|
||||
<pre><code class="language-javascript">['01.01.2014','02.01.2014','03.01.2014','04.01.2014','05.01.2014','06.01.2014']</code></pre>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="disabledDates">
|
||||
@ -885,7 +885,7 @@ jQuery(function(){
|
||||
<td>[]</td>
|
||||
<td><p>Disbale all dates in list</p></td>
|
||||
<td>
|
||||
<pre><code data-language="javascript">{disabledDates: ['01.01.2014','02.01.2014','03.01.2014','04.01.2014','05.01.2014','06.01.2014'], formatDate:'d.m.Y'}</code></pre>
|
||||
<pre><code class="language-javascript">{disabledDates: ['01.01.2014','02.01.2014','03.01.2014','04.01.2014','05.01.2014','06.01.2014'], formatDate:'d.m.Y'}</code></pre>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="allowDates">
|
||||
@ -893,7 +893,7 @@ jQuery(function(){
|
||||
<td>[]</td>
|
||||
<td><p>Allow all dates in list</p></td>
|
||||
<td>
|
||||
<pre><code data-language="javascript">{allowDates: ['01.01.2014','02.01.2014','03.01.2014','04.01.2014','05.01.2014','06.01.2014'], formatDate:'d.m.Y'}</code></pre>
|
||||
<pre><code class="language-javascript">{allowDates: ['01.01.2014','02.01.2014','03.01.2014','04.01.2014','05.01.2014','06.01.2014'], formatDate:'d.m.Y'}</code></pre>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="allowDateRe">
|
||||
@ -901,7 +901,7 @@ jQuery(function(){
|
||||
<td>[]</td>
|
||||
<td><p>Use Regex to check dates</p></td>
|
||||
<td>
|
||||
<pre><code data-language="javascript">{format:'Y-m-d',allowDateRe:'\d{4}-(03-31|06-30|09-30|12-31)' }</code></pre>
|
||||
<pre><code class="language-javascript">{format:'Y-m-d',allowDateRe:'\d{4}-(03-31|06-30|09-30|12-31)' }</code></pre>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="disabledWeekDays">
|
||||
@ -909,7 +909,7 @@ jQuery(function(){
|
||||
<td>[]</td>
|
||||
<td><p>Disable days listed by index</p></td>
|
||||
<td>
|
||||
<pre><code data-language="javascript">[0, 3, 4]</code></pre>
|
||||
<pre><code class="language-javascript">[0, 3, 4]</code></pre>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="id">
|
||||
@ -924,36 +924,48 @@ jQuery(function(){
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr id="ownerDocument">
|
||||
<td>ownerDocument</td>
|
||||
<td>document</td>
|
||||
<td>The ownerDocument object for the datetimepicker to properly attach events and calc position (iframe support).</td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr id="contentWindow">
|
||||
<td>contentWindow</td>
|
||||
<td>window</td>
|
||||
<td>The contentWindow object that contains the datetimepicker to properly attach events (iframe support).</td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<hr>
|
||||
<h2 id="methods">Methods</h2>
|
||||
<h3>show</h3>
|
||||
<p>Show Datetimepicker</p>
|
||||
<pre><code data-language="javascript">$('#input').datetimepicker();
|
||||
<pre><code class="language-javascript">$('#input').datetimepicker();
|
||||
$('button.somebutton').on('click', function () {
|
||||
$('#input').datetimepicker('show');
|
||||
});</code></pre>
|
||||
<h3>hide</h3>
|
||||
<p>Hide Datetimepicker</p>
|
||||
<pre><code data-language="javascript">$('#input').datetimepicker();
|
||||
<pre><code class="language-javascript">$('#input').datetimepicker();
|
||||
$(window).on('resize', function () {
|
||||
$('#input').datetimepicker('hide');
|
||||
});</code></pre>
|
||||
<h3>toggle</h3>
|
||||
<p>Sgow/Hide Datetimepicker</p>
|
||||
<pre><code data-language="javascript">$('#input').datetimepicker();
|
||||
<pre><code class="language-javascript">$('#input').datetimepicker();
|
||||
$('button.trigger').on('click', function () {
|
||||
$('#input').datetimepicker('toggle');
|
||||
});</code></pre>
|
||||
<h3>destroy</h3>
|
||||
<p>Destroy datetimepicker</p>
|
||||
<pre><code data-language="javascript">$('#input').datetimepicker();
|
||||
<pre><code class="language-javascript">$('#input').datetimepicker();
|
||||
$('#input').datetimepicker('destroy');
|
||||
</code></pre>
|
||||
<h3>reset</h3>
|
||||
<p>Reset datetimepicker's value</p>
|
||||
<pre><code data-language="javascript">$('#input').datetimepicker();
|
||||
<pre><code class="language-javascript">$('#input').datetimepicker();
|
||||
$('#input').val('12/01/2006');
|
||||
$('#input')
|
||||
.datetimepicker('show')
|
||||
@ -961,19 +973,19 @@ $('#input')
|
||||
</code></pre>
|
||||
<h3>validate</h3>
|
||||
<p>Validate datetimepicker's value </p>
|
||||
<pre><code data-language="javascript">$('#input').datetimepicker();
|
||||
<pre><code class="language-javascript">$('#input').datetimepicker();
|
||||
$('#input').datetimepicker(validate)
|
||||
</code></pre>
|
||||
<h3>setOptions</h3>
|
||||
<p>Set datetimepicker's options </p>
|
||||
<pre><code data-language="javascript">$('#input').datetimepicker({format: 'd.m.Y'});
|
||||
<pre><code class="language-javascript">$('#input').datetimepicker({format: 'd.m.Y'});
|
||||
$('#input').datetimepicker('setOptions', {format: 'd/m/Y'});
|
||||
//or
|
||||
$('#input').datetimepicker({format: 'd/m/Y'});
|
||||
</code></pre>
|
||||
<h3>getValue</h3>
|
||||
<p>Get current datetimepicker's value (Date object) </p>
|
||||
<pre><code data-language="javascript">$('#input').datetimepicker();
|
||||
<pre><code class="language-javascript">$('#input').datetimepicker();
|
||||
$('button.somebutton').on('click', function () {
|
||||
var d = $('#input').datetimepicker('getValue');
|
||||
console.log(d.getFullYear());
|
||||
|
@ -78,7 +78,9 @@
|
||||
<input type="text" id="datetimepicker_format" class="input input-wide"/>
|
||||
</body>
|
||||
<script src="./jquery.js"></script>
|
||||
<script src="build/jquery.datetimepicker.full.js"></script>
|
||||
<script src="node_modules/php-date-formatter/js/php-date-formatter.min.js"></script>
|
||||
<script src="node_modules/jquery-mousewheel/jquery.mousewheel.js"></script>
|
||||
<script src="jquery.datetimepicker.js"></script>
|
||||
<script>/*
|
||||
window.onerror = function(errorMsg) {
|
||||
$('#console').html($('#console').html()+'<br>'+errorMsg)
|
||||
|
@ -102,7 +102,7 @@
|
||||
margin-bottom: 3px
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_mounthpicker {
|
||||
.xdsoft_datetimepicker .xdsoft_monthpicker {
|
||||
position: relative;
|
||||
text-align: center;
|
||||
}
|
||||
|
770
jquery.datetimepicker.js
Executable file → Normal file
770
jquery.datetimepicker.js
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
2
jquery.datetimepicker.min.js
vendored
2
jquery.datetimepicker.min.js
vendored
File diff suppressed because one or more lines are too long
13
package.json
13
package.json
@ -1,15 +1,16 @@
|
||||
{
|
||||
"name": "jquery-datetimepicker",
|
||||
"version": "2.5.3",
|
||||
"version": "2.5.16",
|
||||
"description": "jQuery Plugin DateTimePicker it is DatePicker and TimePicker in one",
|
||||
"main": "build/jquery.datetimepicker.full.min.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"concat": "concat-cli -f bower_components/php-date-formatter/js/php-date-formatter.js jquery.datetimepicker.js bower_components/jquery-mousewheel/jquery.mousewheel.js -o build/jquery.datetimepicker.full.js",
|
||||
"concat": "concat-cli -f node_modules/php-date-formatter/js/php-date-formatter.min.js jquery.datetimepicker.js node_modules/jquery-mousewheel/jquery.mousewheel.js -o build/jquery.datetimepicker.full.js",
|
||||
"minify": "uglifyjs jquery.datetimepicker.js -c -m -o build/jquery.datetimepicker.min.js && uglifycss jquery.datetimepicker.css > build/jquery.datetimepicker.min.css",
|
||||
"minifyconcat": "uglifyjs build/jquery.datetimepicker.full.js -c -m -o build/jquery.datetimepicker.full.min.js",
|
||||
"github": "git add --all && git commit -m \"New version %npm_package_version% Fix devDependencies with concat-cli\" && git tag %npm_package_version% && git push --tags origin HEAD:master && npm publish",
|
||||
"build": "npm run minify && npm run concat && npm run minifyconcat"
|
||||
"github": "git add --all && git commit -m \"New version %npm_package_version% \" && git tag %npm_package_version% && git push --tags origin HEAD:master && npm publish",
|
||||
"build": "npm run minify && npm run concat && npm run minifyconcat",
|
||||
"public": "npm version patch --no-git-tag-version && npm run build && npm run github"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@ -33,12 +34,12 @@
|
||||
"dependencies": {
|
||||
"jquery": ">= 1.7.2",
|
||||
"jquery-mousewheel": ">= 3.1.13",
|
||||
"php-date-formatter": ">= 1.3.3"
|
||||
"php-date-formatter": "^1.3.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"concat": "azer/concat",
|
||||
"concat-cli": "^4.0.0",
|
||||
"uglifycss": "0.0.20",
|
||||
"uglifycss": "^0.0.27",
|
||||
"uglifyjs": "^2.4.10"
|
||||
}
|
||||
}
|
||||
|
0
tests/input_in_container_fixed_to_bottom_of_viewport.html
Executable file → Normal file
0
tests/input_in_container_fixed_to_bottom_of_viewport.html
Executable file → Normal file
0
tests/input_in_container_fixed_to_top_of_viewport.html
Executable file → Normal file
0
tests/input_in_container_fixed_to_top_of_viewport.html
Executable file → Normal file
175
yarn.lock
Normal file
175
yarn.lock
Normal file
@ -0,0 +1,175 @@
|
||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
ansi-regex@^2.0.0:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
|
||||
|
||||
ansi-styles@^2.2.1:
|
||||
version "2.2.1"
|
||||
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"
|
||||
|
||||
camelcase@^2.0.1:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f"
|
||||
|
||||
chalk@^1.1.1:
|
||||
version "1.1.3"
|
||||
resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
|
||||
dependencies:
|
||||
ansi-styles "^2.2.1"
|
||||
escape-string-regexp "^1.0.2"
|
||||
has-ansi "^2.0.0"
|
||||
strip-ansi "^3.0.0"
|
||||
supports-color "^2.0.0"
|
||||
|
||||
cliui@^3.0.3:
|
||||
version "3.2.0"
|
||||
resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d"
|
||||
dependencies:
|
||||
string-width "^1.0.1"
|
||||
strip-ansi "^3.0.1"
|
||||
wrap-ansi "^2.0.0"
|
||||
|
||||
code-point-at@^1.0.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"
|
||||
|
||||
commander@^2.9.0:
|
||||
version "2.11.0"
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563"
|
||||
|
||||
concat-cli@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/concat-cli/-/concat-cli-4.0.0.tgz#a73a0fb0d18b25804ebe703bcc35922324dbf74d"
|
||||
dependencies:
|
||||
chalk "^1.1.1"
|
||||
concat "^1.0.0"
|
||||
yargs "^3.30.0"
|
||||
|
||||
concat@^1.0.0:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/concat/-/concat-1.0.3.tgz#40f3353089d65467695cb1886b45edd637d8cca8"
|
||||
dependencies:
|
||||
commander "^2.9.0"
|
||||
|
||||
concat@azer/concat:
|
||||
version "1.0.0"
|
||||
resolved "https://codeload.github.com/azer/concat/tar.gz/c64c5cbc2e60b0bc1a8f4bceafed661f66f19dcf"
|
||||
dependencies:
|
||||
parallel-loop azer/parallel-loop
|
||||
serial-loop azer/serial-loop
|
||||
|
||||
decamelize@^1.1.1:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
|
||||
|
||||
escape-string-regexp@^1.0.2:
|
||||
version "1.0.5"
|
||||
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
|
||||
|
||||
has-ansi@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91"
|
||||
dependencies:
|
||||
ansi-regex "^2.0.0"
|
||||
|
||||
invert-kv@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6"
|
||||
|
||||
is-fullwidth-code-point@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb"
|
||||
dependencies:
|
||||
number-is-nan "^1.0.0"
|
||||
|
||||
"jquery-mousewheel@>= 3.1.13":
|
||||
version "3.1.13"
|
||||
resolved "https://registry.yarnpkg.com/jquery-mousewheel/-/jquery-mousewheel-3.1.13.tgz#06f0335f16e353a695e7206bf50503cb523a6ee5"
|
||||
|
||||
"jquery@>= 1.7.2":
|
||||
version "3.2.1"
|
||||
resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.2.1.tgz#5c4d9de652af6cd0a770154a631bba12b015c787"
|
||||
|
||||
lcid@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835"
|
||||
dependencies:
|
||||
invert-kv "^1.0.0"
|
||||
|
||||
number-is-nan@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d"
|
||||
|
||||
os-locale@^1.4.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9"
|
||||
dependencies:
|
||||
lcid "^1.0.0"
|
||||
|
||||
parallel-loop@azer/parallel-loop:
|
||||
version "0.0.2"
|
||||
resolved "https://codeload.github.com/azer/parallel-loop/tar.gz/054b0d3fe633483a3a6b94104c8343473208d5fb"
|
||||
|
||||
php-date-formatter@^1.3.4:
|
||||
version "1.3.4"
|
||||
resolved "https://registry.yarnpkg.com/php-date-formatter/-/php-date-formatter-1.3.4.tgz#09a15ae0766ba0beb1900c27c1ec319ef2e4563e"
|
||||
|
||||
serial-loop@azer/serial-loop:
|
||||
version "0.0.1"
|
||||
resolved "https://codeload.github.com/azer/serial-loop/tar.gz/99c6271f80f075b7db089a1aadc7178a310a4570"
|
||||
|
||||
string-width@^1.0.1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"
|
||||
dependencies:
|
||||
code-point-at "^1.0.0"
|
||||
is-fullwidth-code-point "^1.0.0"
|
||||
strip-ansi "^3.0.0"
|
||||
|
||||
strip-ansi@^3.0.0, strip-ansi@^3.0.1:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
|
||||
dependencies:
|
||||
ansi-regex "^2.0.0"
|
||||
|
||||
supports-color@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7"
|
||||
|
||||
uglifycss@^0.0.27:
|
||||
version "0.0.27"
|
||||
resolved "https://registry.yarnpkg.com/uglifycss/-/uglifycss-0.0.27.tgz#53553b8115de26dce57b42ba0b34e88dd80d0cde"
|
||||
|
||||
uglifyjs@^2.4.10:
|
||||
version "2.4.11"
|
||||
resolved "https://registry.yarnpkg.com/uglifyjs/-/uglifyjs-2.4.11.tgz#3440d64e045759589524418eb641c68bb90d113e"
|
||||
|
||||
window-size@^0.1.4:
|
||||
version "0.1.4"
|
||||
resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876"
|
||||
|
||||
wrap-ansi@^2.0.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85"
|
||||
dependencies:
|
||||
string-width "^1.0.1"
|
||||
strip-ansi "^3.0.1"
|
||||
|
||||
y18n@^3.2.0:
|
||||
version "3.2.1"
|
||||
resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41"
|
||||
|
||||
yargs@^3.30.0:
|
||||
version "3.32.0"
|
||||
resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995"
|
||||
dependencies:
|
||||
camelcase "^2.0.1"
|
||||
cliui "^3.0.3"
|
||||
decamelize "^1.1.1"
|
||||
os-locale "^1.4.0"
|
||||
string-width "^1.0.1"
|
||||
window-size "^0.1.4"
|
||||
y18n "^3.2.0"
|
Loading…
Reference in New Issue
Block a user