mirror of
https://github.com/xdan/datetimepicker.git
synced 2024-11-18 06:24:22 +00:00
In bower was added datetimepicker.full.js
This commit is contained in:
parent
661fc2ca1e
commit
102d60b41d
@ -1,8 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name": "datetimepicker",
|
"name": "datetimepicker",
|
||||||
"version": "2.4.6",
|
"version": "2.4.7",
|
||||||
"main": [
|
"main": [
|
||||||
"jquery.datetimepicker.js",
|
"build/jquery.datetimepicker.full.js",
|
||||||
|
"build/jquery.datetimepicker.full.min.js",
|
||||||
"jquery.datetimepicker.css"
|
"jquery.datetimepicker.css"
|
||||||
],
|
],
|
||||||
"ignore": [
|
"ignore": [
|
||||||
|
@ -574,13 +574,12 @@ var DateFormatter;
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();/* global DateFormatter */
|
})();/**
|
||||||
/**
|
* @preserve jQuery DateTimePicker plugin v2.4.7
|
||||||
* @preserve jQuery DateTimePicker plugin v2.4.5
|
|
||||||
* @homepage http://xdsoft.net/jqplugins/datetimepicker/
|
* @homepage http://xdsoft.net/jqplugins/datetimepicker/
|
||||||
* (c) 2014, Chupurnov Valeriy.
|
* @author Chupurnov Valeriy (<chupurnov@gmail.com>)
|
||||||
*/
|
*/
|
||||||
/*global document,window,jQuery,setTimeout,clearTimeout,HighlightedDate,getCurrentValue*/
|
/*global DateFormatter, document,window,jQuery,setTimeout,clearTimeout,HighlightedDate,getCurrentValue*/
|
||||||
;(function (factory) {
|
;(function (factory) {
|
||||||
if ( typeof define === 'function' && define.amd ) {
|
if ( typeof define === 'function' && define.amd ) {
|
||||||
// AMD. Register as an anonymous module.
|
// AMD. Register as an anonymous module.
|
||||||
@ -1132,6 +1131,7 @@ var DateFormatter;
|
|||||||
onSelectDate: function () {},
|
onSelectDate: function () {},
|
||||||
onSelectTime: function () {},
|
onSelectTime: function () {},
|
||||||
onChangeMonth: function () {},
|
onChangeMonth: function () {},
|
||||||
|
onGetWeekOfYear: function () {},
|
||||||
onChangeYear: function () {},
|
onChangeYear: function () {},
|
||||||
onChangeDateTime: function () {},
|
onChangeDateTime: function () {},
|
||||||
onShow: function () {},
|
onShow: function () {},
|
||||||
@ -1172,6 +1172,8 @@ var DateFormatter;
|
|||||||
weekends: [],
|
weekends: [],
|
||||||
highlightedDates: [],
|
highlightedDates: [],
|
||||||
highlightedPeriods: [],
|
highlightedPeriods: [],
|
||||||
|
allowDates : [],
|
||||||
|
allowDateRe : null,
|
||||||
disabledDates : [],
|
disabledDates : [],
|
||||||
disabledWeekDays: [],
|
disabledWeekDays: [],
|
||||||
yearOffset: 0,
|
yearOffset: 0,
|
||||||
@ -1626,6 +1628,14 @@ var DateFormatter;
|
|||||||
options.weekends = $.extend(true, [], _options.weekends);
|
options.weekends = $.extend(true, [], _options.weekends);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_options.allowDates && $.isArray(_options.allowDates) && _options.allowDates.length) {
|
||||||
|
options.allowDates = $.extend(true, [], _options.allowDates);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_options.allowDateRe && Object.prototype.toString.call(_options.allowDateRe)==="[object String]") {
|
||||||
|
options.allowDateRe = new RegExp(_options.allowDateRe);
|
||||||
|
}
|
||||||
|
|
||||||
if (_options.highlightedDates && $.isArray(_options.highlightedDates) && _options.highlightedDates.length) {
|
if (_options.highlightedDates && $.isArray(_options.highlightedDates) && _options.highlightedDates.length) {
|
||||||
$.each(_options.highlightedDates, function (index, value) {
|
$.each(_options.highlightedDates, function (index, value) {
|
||||||
var splitData = $.map(value.split(','), $.trim),
|
var splitData = $.map(value.split(','), $.trim),
|
||||||
@ -2011,7 +2021,16 @@ var DateFormatter;
|
|||||||
};
|
};
|
||||||
|
|
||||||
_this.getWeekOfYear = function (datetime) {
|
_this.getWeekOfYear = function (datetime) {
|
||||||
|
if (options.onGetWeekOfYear && $.isFunction(options.onGetWeekOfYear)) {
|
||||||
|
var week = options.onGetWeekOfYear.call(datetimepicker, datetime);
|
||||||
|
if (typeof week !== 'undefined') {
|
||||||
|
return week;
|
||||||
|
}
|
||||||
|
}
|
||||||
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
|
||||||
|
if(onejan.getDay()!=4)
|
||||||
|
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);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2236,7 +2255,15 @@ var DateFormatter;
|
|||||||
customDateSettings = null;
|
customDateSettings = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((maxDate !== false && start > maxDate) || (minDate !== false && start < minDate) || (customDateSettings && customDateSettings[0] === false)) {
|
if(options.allowDateRe && Object.prototype.toString.call(options.allowDateRe) === "[object RegExp]"){
|
||||||
|
if(!options.allowDateRe.test(start.dateFormat(options.formatDate))){
|
||||||
|
classes.push('xdsoft_disabled');
|
||||||
|
}
|
||||||
|
} else if(options.allowDates && options.allowDates.length>0){
|
||||||
|
if(options.allowDates.indexOf(start.dateFormat(options.formatDate)) === -1){
|
||||||
|
classes.push('xdsoft_disabled');
|
||||||
|
}
|
||||||
|
} else if ((maxDate !== false && start > maxDate) || (minDate !== false && start < minDate) || (customDateSettings && customDateSettings[0] === false)) {
|
||||||
classes.push('xdsoft_disabled');
|
classes.push('xdsoft_disabled');
|
||||||
} else if (options.disabledDates.indexOf(dateHelper.formatDate(start, options.formatDate)) !== -1) {
|
} else if (options.disabledDates.indexOf(dateHelper.formatDate(start, options.formatDate)) !== -1) {
|
||||||
classes.push('xdsoft_disabled');
|
classes.push('xdsoft_disabled');
|
||||||
@ -2537,7 +2564,26 @@ var DateFormatter;
|
|||||||
current_time_index = 0;
|
current_time_index = 0;
|
||||||
|
|
||||||
setPos = function () {
|
setPos = function () {
|
||||||
var offset = datetimepicker.data('input').offset(), datetimepickerelement = datetimepicker.data('input')[0], top = offset.top + datetimepickerelement.offsetHeight - 1, left = offset.left, position = "absolute", node;
|
/**
|
||||||
|
* 修复输入框在window最右边,且输入框的宽度小于日期控件宽度情况下,日期控件显示不全的bug。
|
||||||
|
* Bug fixed - The datetimepicker will overflow-y when the width of the date input less than its, which
|
||||||
|
* could causes part of the datetimepicker being hidden.
|
||||||
|
* by Soon start
|
||||||
|
*/
|
||||||
|
var offset = datetimepicker.data('input').offset(),
|
||||||
|
datetimepickerelement = datetimepicker.data('input')[0],
|
||||||
|
top = offset.top + datetimepickerelement.offsetHeight - 1,
|
||||||
|
left = offset.left,
|
||||||
|
position = "absolute",
|
||||||
|
node;
|
||||||
|
|
||||||
|
if ((document.documentElement.clientWidth - offset.left) < datepicker.parent().outerWidth(true)) {
|
||||||
|
var diff = datepicker.parent().outerWidth(true) - datetimepickerelement.offsetWidth;
|
||||||
|
left = left - diff;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* by Soon end
|
||||||
|
*/
|
||||||
if (datetimepicker.data('input').parent().css('direction') == 'rtl')
|
if (datetimepicker.data('input').parent().css('direction') == 'rtl')
|
||||||
left -= (datetimepicker.outerWidth() - datetimepicker.data('input').outerWidth());
|
left -= (datetimepicker.outerWidth() - datetimepicker.data('input').outerWidth());
|
||||||
if (options.fixed) {
|
if (options.fixed) {
|
||||||
|
4
build/jquery.datetimepicker.full.min.js
vendored
4
build/jquery.datetimepicker.full.min.js
vendored
File diff suppressed because one or more lines are too long
4
build/jquery.datetimepicker.min.js
vendored
4
build/jquery.datetimepicker.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "datetimepicker",
|
"name": "datetimepicker",
|
||||||
"version": "2.4.6",
|
"version": "2.4.7",
|
||||||
"title": "jQuery Date and Time picker",
|
"title": "jQuery Date and Time picker",
|
||||||
"description": "jQuery plugin for date, time, or datetime manipulation in form",
|
"description": "jQuery plugin for date, time, or datetime manipulation in form",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @preserve jQuery DateTimePicker plugin v2.4.6
|
* @preserve jQuery DateTimePicker plugin v2.4.7
|
||||||
* @homepage http://xdsoft.net/jqplugins/datetimepicker/
|
* @homepage http://xdsoft.net/jqplugins/datetimepicker/
|
||||||
* @author Chupurnov Valeriy (<chupurnov@gmail.com>)
|
* @author Chupurnov Valeriy (<chupurnov@gmail.com>)
|
||||||
*/
|
*/
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "jquery-datetimepicker",
|
"name": "jquery-datetimepicker",
|
||||||
"version": "2.4.5",
|
"version": "2.4.7",
|
||||||
"description": "jQuery Plugin DateTimePicker it is DatePicker and TimePicker in one",
|
"description": "jQuery Plugin DateTimePicker it is DatePicker and TimePicker in one",
|
||||||
"main": "jquery.datetimepicker.js",
|
"main": "jquery.datetimepicker.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
Loading…
Reference in New Issue
Block a user