New version 2.5.5

This commit is contained in:
Chupurnov Valeriy 2017-10-12 13:18:22 +05:00
parent b5443286af
commit 6f86f8c9ca
13 changed files with 207 additions and 217 deletions

3
.gitignore vendored
View File

@ -1,3 +0,0 @@
parse.php
bower_components
node_modules

View File

@ -5,9 +5,9 @@ This file will be automatically displayed on the site
# Installation # Installation
``` ```
npm install datetimepicker-jquery npm install jquery-datetimepicker
OR OR
yarn add datetimepicker-jquery yarn add jquery-datetimepicker
``` ```
# datetimepicker # datetimepicker

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

View File

@ -70,7 +70,7 @@
} }
.xdsoft_datetimepicker .xdsoft_datepicker { .xdsoft_datetimepicker .xdsoft_datepicker {
width: 300px; width: 224px;
float: left; float: left;
margin-left: 8px; margin-left: 8px;
} }

69
jquery.datetimepicker.js Executable file → Normal file
View File

@ -1,22 +1,15 @@
/** /**
* @preserve jQuery DateTimePicker plugin v2.5.4 * @preserve jQuery DateTimePicker
* @homepage http://xdsoft.net/jqplugins/datetimepicker/ * @homepage http://xdsoft.net/jqplugins/datetimepicker/
* @author Chupurnov Valeriy (<chupurnov@gmail.com>) * @author Chupurnov Valeriy (<chupurnov@gmail.com>)
*/ */
/*global DateFormatter, document,window,jQuery,setTimeout,clearTimeout,HighlightedDate,getCurrentValue*/
;(function (factory) { /**
if ( typeof define === 'function' && define.amd ) { * @param {jQuery} $
// AMD. Register as an anonymous module. */
define(['jquery', 'jquery-mousewheel'], factory); var datetimepickerFactory = function ($) {
} else if (typeof exports === 'object') {
// Node/CommonJS style for Browserify
module.exports = factory;
} else {
// Browser globals
factory(jQuery);
}
}(function ($) {
'use strict'; 'use strict';
var default_options = { var default_options = {
i18n: { i18n: {
ar: { // Arabic ar: { // Arabic
@ -663,15 +656,17 @@
$.datetimepicker = { $.datetimepicker = {
setLocale: function(locale){ setLocale: function(locale){
var newLocale = default_options.i18n[locale] ? locale : globalLocaleDefault; var newLocale = default_options.i18n[locale] ? locale : globalLocaleDefault;
if(globalLocale != newLocale){ if (globalLocale !== newLocale) {
globalLocale = newLocale; globalLocale = newLocale;
// reinit date formatter // reinit date formatter
initDateFormatter(); initDateFormatter();
} }
}, },
setDateFormatter: function(dateFormatter) { setDateFormatter: function(dateFormatter) {
dateHelper = dateFormatter; dateHelper = dateFormatter;
}, },
RFC_2822: 'D, d M Y H:i:s O', RFC_2822: 'D, d M Y H:i:s O',
ATOM: 'Y-m-d\TH:i:sP', ATOM: 'Y-m-d\TH:i:sP',
ISO_8601: 'Y-m-d\TH:i:sO', ISO_8601: 'Y-m-d\TH:i:sO',
@ -688,10 +683,10 @@
// fix for ie8 // fix for ie8
if (!window.getComputedStyle) { if (!window.getComputedStyle) {
window.getComputedStyle = function (el, pseudo) { window.getComputedStyle = function (el) {
this.el = el; this.el = el;
this.getPropertyValue = function (prop) { this.getPropertyValue = function (prop) {
var re = /(\-([a-z]){1})/g; var re = /(-([a-z]))/g;
if (prop === 'float') { if (prop === 'float') {
prop = 'styleFloat'; prop = 'styleFloat';
} }
@ -714,9 +709,11 @@
return -1; return -1;
}; };
} }
Date.prototype.countDaysInMonth = function () { Date.prototype.countDaysInMonth = function () {
return new Date(this.getFullYear(), this.getMonth() + 1, 0).getDate(); return new Date(this.getFullYear(), this.getMonth() + 1, 0).getDate();
}; };
$.fn.xdsoftScroller = function (options, percent) { $.fn.xdsoftScroller = function (options, percent) {
return this.each(function () { return this.each(function () {
var timeboxparent = $(this), var timeboxparent = $(this),
@ -746,10 +743,12 @@
touchStart = false, touchStart = false,
startTopScroll = 0, startTopScroll = 0,
calcOffset = function () {}; calcOffset = function () {};
if (percent === 'hide') { if (percent === 'hide') {
timeboxparent.find('.xdsoft_scrollbar').hide(); timeboxparent.find('.xdsoft_scrollbar').hide();
return; return;
} }
if (!$(this).hasClass('xdsoft_scroller_box')) { if (!$(this).hasClass('xdsoft_scroller_box')) {
timebox = timeboxparent.children().eq(0); timebox = timeboxparent.children().eq(0);
parentHeight = timeboxparent[0].clientHeight; parentHeight = timeboxparent[0].clientHeight;
@ -1197,7 +1196,8 @@
input input
.off('blur.xdsoft') .off('blur.xdsoft')
.on('blur.xdsoft', function () { .on('blur.xdsoft', function () {
if (options.allowBlank && (!$.trim($(this).val()).length || (typeof options.mask == "string" && $.trim($(this).val()) === options.mask.replace(/[0-9]/g, '_')))) { if (options.allowBlank && (!$.trim($(this).val()).length ||
(typeof options.mask === "string" && $.trim($(this).val()) === options.mask.replace(/[0-9]/g, '_')))) {
$(this).val(null); $(this).val(null);
datetimepicker.data('xdsoft_datetime').empty(); datetimepicker.data('xdsoft_datetime').empty();
} else { } else {
@ -1320,7 +1320,7 @@
_this.currentTime = null; _this.currentTime = null;
}; };
_this.getCurrentTime = function (dTime) { _this.getCurrentTime = function () {
return _this.currentTime; return _this.currentTime;
}; };
@ -1392,9 +1392,12 @@
} }
} }
var onejan = new Date(datetime.getFullYear(), 0, 1); var onejan = new Date(datetime.getFullYear(), 0, 1);
//First week of the year is th one with the first Thursday according to ISO8601 //First week of the year is th one with the first Thursday according to ISO8601
if(onejan.getDay()!=4) if (onejan.getDay() !== 4) {
onejan.setMonth(0, 1 + ((4 - onejan.getDay()+ 7) % 7)); onejan.setMonth(0, 1 + ((4 - onejan.getDay()+ 7) % 7));
}
return Math.ceil((((datetime - onejan) / 86400000) + onejan.getDay() + 1) / 7); return Math.ceil((((datetime - onejan) / 86400000) + onejan.getDay() + 1) / 7);
}; };
@ -1405,10 +1408,12 @@
return sDateTime; return sDateTime;
} }
tmpDate = /^(\+|\-)(.*)$/.exec(sDateTime); tmpDate = /^([+-]{1})(.*)$/.exec(sDateTime);
if (tmpDate) { if (tmpDate) {
tmpDate[2] = dateHelper.parseDate(tmpDate[2], options.formatDate); tmpDate[2] = dateHelper.parseDate(tmpDate[2], options.formatDate);
} }
if (tmpDate && tmpDate[2]) { if (tmpDate && tmpDate[2]) {
timeOffset = tmpDate[2].getTime() - (tmpDate[2].getTimezoneOffset()) * 60000; timeOffset = tmpDate[2].getTime() - (tmpDate[2].getTimezoneOffset()) * 60000;
currentTime = new Date((_this.now(true)).getTime() + parseInt(tmpDate[1] + '1', 10) * timeOffset); currentTime = new Date((_this.now(true)).getTime() + parseInt(tmpDate[1] + '1', 10) * timeOffset);
@ -1582,7 +1587,7 @@
customDateSettings, customDateSettings,
newRow = true, newRow = true,
time = '', time = '',
h = '', h,
line_time, line_time,
description; description;
@ -1769,7 +1774,6 @@
timebox.html(time); timebox.html(time);
opt = ''; opt = '';
i = 0;
for (i = parseInt(options.yearStart, 10) + options.yearOffset; i <= parseInt(options.yearEnd, 10) + options.yearOffset; i += 1) { for (i = parseInt(options.yearStart, 10) + options.yearOffset; i <= parseInt(options.yearEnd, 10) + options.yearOffset; i += 1) {
opt += '<div class="xdsoft_option ' + (_xdsoft_datetime.currentTime.getFullYear() === i ? 'xdsoft_current' : '') + '" data-value="' + i + '">' + i + '</div>'; opt += '<div class="xdsoft_option ' + (_xdsoft_datetime.currentTime.getFullYear() === i ? 'xdsoft_current' : '') + '" data-value="' + i + '">' + i + '</div>';
@ -2191,9 +2195,11 @@
} }
return false; return false;
}; };
if(options.mask) { if(options.mask) {
input.off('keydown.xdsoft'); input.off('keydown.xdsoft');
} }
if (options.mask === true) { if (options.mask === true) {
if (typeof moment != 'undefined') { if (typeof moment != 'undefined') {
options.mask = options.format options.mask = options.format
@ -2242,6 +2248,7 @@
} }
val = val.substr(0, pos) + digit + val.substr(pos + 1); val = val.substr(0, pos) + digit + val.substr(pos + 1);
if ($.trim(val) === '') { if ($.trim(val) === '') {
val = options.mask.replace(/[0-9]/g, '_'); val = options.mask.replace(/[0-9]/g, '_');
} else { } else {
@ -2404,4 +2411,18 @@
this.desc = desc; this.desc = desc;
this.style = style; this.style = style;
} }
})); };
;(function (factory) {
if ( typeof define === 'function' && define.amd ) {
// AMD. Register as an anonymous module.
define(['jquery', 'jquery-mousewheel'], factory);
} else if (typeof exports === 'object') {
// Node/CommonJS style for Browserify
module.exports = factory;
} else {
// Browser globals
factory(jQuery);
}
}(datetimepickerFactory));

File diff suppressed because one or more lines are too long

6
jquery.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{ {
"name": "jquery-datetimepicker", "name": "jquery-datetimepicker",
"version": "2.5.4", "version": "2.5.5",
"description": "jQuery Plugin DateTimePicker it is DatePicker and TimePicker in one", "description": "jQuery Plugin DateTimePicker it is DatePicker and TimePicker in one",
"main": "build/jquery.datetimepicker.full.min.js", "main": "build/jquery.datetimepicker.full.min.js",
"scripts": { "scripts": {
@ -9,7 +9,8 @@
"minify": "uglifyjs jquery.datetimepicker.js -c -m -o build/jquery.datetimepicker.min.js && uglifycss jquery.datetimepicker.css > build/jquery.datetimepicker.min.css", "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", "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% \" && git tag %npm_package_version% && git push --tags origin HEAD:master && npm publish", "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" "build": "npm run minify && npm run concat && npm run minifyconcat",
"public": "npm version patch --no-git-tag-version && npm run build && npm run github && npm run newversiongit && npm publish ./"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -38,7 +39,7 @@
"devDependencies": { "devDependencies": {
"concat": "azer/concat", "concat": "azer/concat",
"concat-cli": "^4.0.0", "concat-cli": "^4.0.0",
"uglifycss": "0.0.20", "uglifycss": "^0.0.27",
"uglifyjs": "^2.4.10" "uglifyjs": "^2.4.10"
} }
} }

View File

0
tests/input_in_container_fixed_to_top_of_viewport.html Executable file → Normal file
View File

View File

@ -2,10 +2,6 @@
# yarn lockfile v1 # yarn lockfile v1
amdefine@>=0.0.4:
version "1.0.1"
resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5"
ansi-regex@^2.0.0: ansi-regex@^2.0.0:
version "2.1.1" version "2.1.1"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
@ -14,10 +10,6 @@ ansi-styles@^2.2.1:
version "2.2.1" version "2.2.1"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"
async@~0.2.6:
version "0.2.10"
resolved "https://registry.yarnpkg.com/async/-/async-0.2.10.tgz#b6bbe0b0674b9d719708ca38de8c237cb526c3d1"
camelcase@^2.0.1: camelcase@^2.0.1:
version "2.1.1" version "2.1.1"
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f"
@ -44,6 +36,10 @@ code-point-at@^1.0.0:
version "1.1.0" version "1.1.0"
resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" 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: concat-cli@^4.0.0:
version "4.0.0" version "4.0.0"
resolved "https://registry.yarnpkg.com/concat-cli/-/concat-cli-4.0.0.tgz#a73a0fb0d18b25804ebe703bcc35922324dbf74d" resolved "https://registry.yarnpkg.com/concat-cli/-/concat-cli-4.0.0.tgz#a73a0fb0d18b25804ebe703bcc35922324dbf74d"
@ -52,7 +48,13 @@ concat-cli@^4.0.0:
concat "^1.0.0" concat "^1.0.0"
yargs "^3.30.0" yargs "^3.30.0"
concat@^1.0.0, concat@azer/concat: 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" version "1.0.0"
resolved "https://codeload.github.com/azer/concat/tar.gz/c64c5cbc2e60b0bc1a8f4bceafed661f66f19dcf" resolved "https://codeload.github.com/azer/concat/tar.gz/c64c5cbc2e60b0bc1a8f4bceafed661f66f19dcf"
dependencies: dependencies:
@ -119,12 +121,6 @@ serial-loop@azer/serial-loop:
version "0.0.1" version "0.0.1"
resolved "https://codeload.github.com/azer/serial-loop/tar.gz/99c6271f80f075b7db089a1aadc7178a310a4570" resolved "https://codeload.github.com/azer/serial-loop/tar.gz/99c6271f80f075b7db089a1aadc7178a310a4570"
source-map@0.1.34:
version "0.1.34"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.1.34.tgz#a7cfe89aec7b1682c3b198d0acfb47d7d090566b"
dependencies:
amdefine ">=0.0.4"
string-width@^1.0.1: string-width@^1.0.1:
version "1.0.2" version "1.0.2"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"
@ -143,22 +139,13 @@ supports-color@^2.0.0:
version "2.0.0" version "2.0.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7"
uglify-to-browserify@~1.0.0: uglifycss@^0.0.27:
version "1.0.2" version "0.0.27"
resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" resolved "https://registry.yarnpkg.com/uglifycss/-/uglifycss-0.0.27.tgz#53553b8115de26dce57b42ba0b34e88dd80d0cde"
uglifycss@0.0.20:
version "0.0.20"
resolved "https://registry.yarnpkg.com/uglifycss/-/uglifycss-0.0.20.tgz#0f953c3cf989f9ff7447cba24f9999687c9a5910"
uglifyjs@^2.4.10: uglifyjs@^2.4.10:
version "2.4.10" version "2.4.11"
resolved "https://registry.yarnpkg.com/uglifyjs/-/uglifyjs-2.4.10.tgz#632927319fa6a3da3fc91f9773ac27bfe6c3ee92" resolved "https://registry.yarnpkg.com/uglifyjs/-/uglifyjs-2.4.11.tgz#3440d64e045759589524418eb641c68bb90d113e"
dependencies:
async "~0.2.6"
source-map "0.1.34"
uglify-to-browserify "~1.0.0"
yargs "~1.3.3"
window-size@^0.1.4: window-size@^0.1.4:
version "0.1.4" version "0.1.4"
@ -186,7 +173,3 @@ yargs@^3.30.0:
string-width "^1.0.1" string-width "^1.0.1"
window-size "^0.1.4" window-size "^0.1.4"
y18n "^3.2.0" y18n "^3.2.0"
yargs@~1.3.3:
version "1.3.3"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-1.3.3.tgz#054de8b61f22eefdb7207059eaef9d6b83fb931a"