[Pkg-javascript-commits] [eonasdan-bootstrap-datetimepicker] 01/03: New upstream version 4.17.47
Mathias Behrle
mbehrle at moszumanska.debian.org
Mon Oct 9 17:11:59 UTC 2017
This is an automated email from the git hooks/post-receive script.
mbehrle pushed a commit to branch master
in repository eonasdan-bootstrap-datetimepicker.
commit b88e6f8dcf40dea4c691c35b28cf4c263e8172c4
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Mon Sep 11 11:04:30 2017 +0200
New upstream version 4.17.47
---
Gruntfile.js | 3 +-
README.md | 34 +----
bower.json | 2 +-
build/css/bootstrap-datetimepicker.css | 3 +-
build/css/bootstrap-datetimepicker.min.css | 4 +-
build/js/bootstrap-datetimepicker.min.js | 216 +----------------------------
component.json | 2 +-
composer.json | 4 +-
docs/Options.md | 2 +-
package.json | 10 +-
src/js/bootstrap-datetimepicker.js | 59 +++++---
src/less/_bootstrap-datetimepicker.less | 3 +-
test/publicApiSpec.js | 24 +++-
13 files changed, 87 insertions(+), 279 deletions(-)
diff --git a/Gruntfile.js b/Gruntfile.js
index 61e577a..a9f06c6 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -188,7 +188,8 @@ module.exports = function (grunt) {
grunt.task.run([
'bump_version:' + version,
'build:travis',
- 'docs'
+ 'docs',
+ 'nugetpack'
]);
});
};
diff --git a/README.md b/README.md
index 357bf1e..3d238f5 100644
--- a/README.md
+++ b/README.md
@@ -5,40 +5,16 @@
## [View the manual and demos](http://eonasdan.github.io/bootstrap-datetimepicker/)
-#Notice
-The issue tracker is now solely for bug reports.
-
-SO: http://stackoverflow.com/tags/eonasdan-datetimepicker
-
-New issues that are requests for "how do I.." will be closed and redirected to Stack Overflow.
+## [Installation instructions](http://eonasdan.github.io/bootstrap-datetimepicker/Installing/)
-# v4.17.42
+## [Change Log](http://eonasdan.github.io/bootstrap-datetimepicker/Changelog/)
-Is the current stable release. The latest and greatest changes are available from the [development branch](https://github.com/Eonasdan/bootstrap-datetimepicker/tree/development)
+### This issue tracker is no longer actively monitored.
# Version 5
-IMPORANT! The Nuget packages will be depreciated in this release. Moving forward, Asp.Net/Nuget will **NOT** be delivering content packages like this one and you will need to use bower. See [this issue for more]( https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1128)
-
-v5 is [in planning](https://github.com/Eonasdan/bootstrap-datetimepicker/issues/841). We welcome your suggestions.
-
-A major update is a great time to make be able to make breaking changes.
+Version 5 is being completely rewritten in ES6 and modularized as Tempus Dominus.
-## Submitting Issues
-If you have issues, please check the following first:
-* Have you read the docs?
-* Do you have the latest version of momentjs?
-* Do you have the latest version of jQuery?
-* Please test and/or fork [this jsfiddle](http://jsfiddle.net/Eonasdan/0Ltv25o8/) with an example of your issue before you post an issue here.
-* Please indicate which version of the picker you are using (this can be found at the top of any included file)
+v5 is [in alpha](https://github.com/tempusdominus/bootstrap-3).
-## Where do you use this?
-I'd love to know if your public site is using this plugin and list your logo on the documentation site. Please email me `me at eonasdan dot com`.
-##Priority support is available at an hourly rate.
-
-If you have an urgent request, bug or need installation help, please contact me at `me at eonasdan dot com` for a quote.
-
-## [Installation instructions](http://eonasdan.github.io/bootstrap-datetimepicker/Installing/)
-
-## [Change Log](http://eonasdan.github.io/bootstrap-datetimepicker/Changelog/)
diff --git a/bower.json b/bower.json
index e8f47e7..c9d5a75 100644
--- a/bower.json
+++ b/bower.json
@@ -1,6 +1,6 @@
{
"name": "eonasdan-bootstrap-datetimepicker",
- "version": "4.17.42",
+ "version": "4.17.47",
"main": [
"build/css/bootstrap-datetimepicker.min.css",
"build/js/bootstrap-datetimepicker.min.js"
diff --git a/build/css/bootstrap-datetimepicker.css b/build/css/bootstrap-datetimepicker.css
index 33a05fa..7e6488e 100644
--- a/build/css/bootstrap-datetimepicker.css
+++ b/build/css/bootstrap-datetimepicker.css
@@ -1,12 +1,13 @@
/*!
* Datetimepicker for Bootstrap 3
- * version : 4.17.42
+ * version : 4.17.47
* https://github.com/Eonasdan/bootstrap-datetimepicker/
*/
.bootstrap-datetimepicker-widget {
list-style: none;
}
.bootstrap-datetimepicker-widget.dropdown-menu {
+ display: block;
margin: 2px 0;
padding: 4px;
width: 19em;
diff --git a/build/css/bootstrap-datetimepicker.min.css b/build/css/bootstrap-datetimepicker.min.css
index 2ee13b0..5950ad2 100644
--- a/build/css/bootstrap-datetimepicker.min.css
+++ b/build/css/bootstrap-datetimepicker.min.css
@@ -1,5 +1,5 @@
/*!
* Datetimepicker for Bootstrap 3
- * version : 4.17.42
+ * version : 4.17.47
* https://github.com/Eonasdan/bootstrap-datetimepicker/
- */.bootstrap-datetimepicker-widget{list-style:none}.bootstrap-datetimepicker-widget.dropdown-menu{margin:2px 0;padding:4px;width:19em}@media (min-width:768px){.bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs{width:38em}}@media (min-width:992px){.bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs{width:38em}}@media (min-width:1200px){.bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs{width:38em}}.bootstrap-datetimepicker-widget.dropdown-menu:before,.boot [...]
\ No newline at end of file
+ */.bootstrap-datetimepicker-widget{list-style:none}.bootstrap-datetimepicker-widget.dropdown-menu{display:block;margin:2px 0;padding:4px;width:19em}@media (min-width:768px){.bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs{width:38em}}@media (min-width:992px){.bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs{width:38em}}@media (min-width:1200px){.bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs{width:38em}}.bootstrap-datetimepicker-widget.dropdown-men [...]
\ No newline at end of file
diff --git a/build/js/bootstrap-datetimepicker.min.js b/build/js/bootstrap-datetimepicker.min.js
index a953fe0..724db76 100644
--- a/build/js/bootstrap-datetimepicker.min.js
+++ b/build/js/bootstrap-datetimepicker.min.js
@@ -1,214 +1,2 @@
-/*! version : 4.17.42
- =========================================================
- bootstrap-datetimejs
- https://github.com/Eonasdan/bootstrap-datetimepicker
- Copyright (c) 2015 Jonathan Peterson
- =========================================================
- */
-/*
- The MIT License (MIT)
-
- Copyright (c) 2015 Jonathan Peterson
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
- */
-/*global define:false */
-/*global exports:false */
-/*global require:false */
-/*global jQuery:false */
-/*global moment:false */
-!function(a){"use strict";if("function"==typeof define&&define.amd)
-// AMD is used - Register as an anonymous module.
-define(["jquery","moment"],a);else if("object"==typeof exports)a(require("jquery"),require("moment"));else{
-// Neither AMD nor CommonJS used. Use global variables.
-if("undefined"==typeof jQuery)throw"bootstrap-datetimepicker requires jQuery to be loaded first";if("undefined"==typeof moment)throw"bootstrap-datetimepicker requires Moment.js to be loaded first";a(jQuery,moment)}}(function(a,b){"use strict";if(!b)throw new Error("bootstrap-datetimepicker requires Moment.js to be loaded first");var c=function(c,d){var e,f,g,h,i,j,k,l={},m=!0,n=!1,o=!1,p=0,q=[{clsName:"days",navFnc:"M",navStep:1},{clsName:"months",navFnc:"y",navStep:1},{clsName:"years",n [...]
- *
- * Private functions
- *
- ********************************************************************************/
-x=function(){return void 0!==b.tz&&void 0!==d.timeZone&&null!==d.timeZone&&""!==d.timeZone},y=function(a){var c;return c=void 0===a||null===a?b():x()?b.tz(a,j,d.useStrict,d.timeZone):b(a,j,d.useStrict),x()&&c.tz(d.timeZone),c},z=function(a){if("string"!=typeof a||a.length>1)throw new TypeError("isEnabled expects a single character string parameter");switch(a){case"y":return-1!==i.indexOf("Y");case"M":return-1!==i.indexOf("M");case"d":return-1!==i.toLowerCase().indexOf("d");case"h":case"H [...]
-// Top and bottom logic
-"auto"===g&&(g=f.top+1.5*o.height()>=a(window).height()+a(window).scrollTop()&&o.height()+c.outerHeight()<f.top?"top":"bottom"),
-// Left and right logic
-"auto"===h&&(h=b.width()<f.left+o.outerWidth()/2&&f.left+o.outerWidth()>a(window).width()?"right":"left"),"top"===g?o.addClass("top").removeClass("bottom"):o.addClass("bottom").removeClass("top"),"right"===h?o.addClass("pull-right"):o.removeClass("pull-right"),
-// find the first parent element that has a relative css positioning
-"relative"!==b.css("position")&&(b=b.parents().filter(function(){return"relative"===a(this).css("position")}).first()),0===b.length)throw new Error("datetimepicker component should be placed within a relative positioned container");o.css({top:"top"===g?"auto":e.top+c.outerHeight(),bottom:"top"===g?b.outerHeight()-(b===c?0:e.top):"auto",left:"left"===h?b===c?0:e.left:"auto",right:"left"===h?"auto":b.outerWidth()-c.outerWidth()-(b===c?0:e.left)})},J=function(a){"dp.change"===a.type&&(a.dat [...]
-0===b.weekday()&&(c=a("<tr>"),d.calendarWeeks&&c.append('<td class="cw">'+b.week()+"</td>"),k.push(c)),g="",b.isBefore(f,"M")&&(g+=" old"),b.isAfter(f,"M")&&(g+=" new"),b.isSame(e,"d")&&!m&&(g+=" active"),R(b,"d")||(g+=" disabled"),b.isSame(y(),"d")&&(g+=" today"),0!==b.day()&&6!==b.day()||(g+=" weekend"),c.append('<td data-action="selectDay" data-day="'+b.format("L")+'" class="day'+g+'">'+b.date()+"</td>"),b.add(1,"d");i.find("tbody").empty().append(k),T(),U(),V()}},X=function(){var b=o [...]
-// case of calling setValue(null or false)
-// case of calling setValue(null or false)
-//viewDate = date.clone(); // TODO this doesn't work right on first use
-return a?(a=a.clone().locale(d.locale),x()&&a.tz(d.timeZone),1!==d.stepping&&a.minutes(Math.round(a.minutes()/d.stepping)*d.stepping).seconds(0),void(R(a)?(e=a,g.val(e.format(i)),c.data("date",e.format(i)),m=!1,_(),J({type:"dp.change",date:e.clone(),oldDate:b})):(d.keepInvalid?J({type:"dp.change",date:a,oldDate:b}):g.val(m?"":e.format(i)),J({type:"dp.error",date:a,oldDate:b})))):(m=!0,g.val(""),c.data("date",""),J({type:"dp.change",date:!1,oldDate:b}),void _())},/**
- * Hides the widget. Possibly will emit dp.hide
- */
-ba=function(){var b=!1;
-// Ignore event if in the middle of a picker transition
-return o?(o.find(".collapse").each(function(){var c=a(this).data("collapse");return c&&c.transitioning?(b=!0,!1):!0}),b?l:(n&&n.hasClass("btn")&&n.toggleClass("active"),o.hide(),a(window).off("resize",I),o.off("click","[data-action]"),o.off("mousedown",!1),o.remove(),o=!1,J({type:"dp.hide",date:e.clone()}),g.blur(),k=0,f=e.clone(),l)):l},ca=function(){aa(null)},da=function(a){
-//inputDate.locale(options.locale);
-return void 0===d.parseInputDate?b.isMoment(a)||(a=y(a)):a=d.parseInputDate(a),a},/********************************************************************************
- *
- * Widget UI interaction functions
- *
- ********************************************************************************/
-ea={next:function(){var a=q[k].navFnc;f.add(q[k].navStep,a),W(),K(a)},previous:function(){var a=q[k].navFnc;f.subtract(q[k].navStep,a),W(),K(a)},pickerSwitch:function(){L(1)},selectMonth:function(b){var c=a(b.target).closest("tbody").find("span").index(a(b.target));f.month(c),k===p?(aa(e.clone().year(f.year()).month(f.month())),d.inline||ba()):(L(-1),W()),K("M")},selectYear:function(b){var c=parseInt(a(b.target).text(),10)||0;f.year(c),k===p?(aa(e.clone().year(f.year())),d.inline||ba()): [...]
-g.collapse("hide"),h.collapse("show")):(// otherwise just toggle in class on the two views
-g.removeClass("in"),h.addClass("in")),e.is("span")?e.toggleClass(d.icons.time+" "+d.icons.date):e.find("span").toggleClass(d.icons.time+" "+d.icons.date)}},showPicker:function(){o.find(".timepicker > div:not(.timepicker-picker)").hide(),o.find(".timepicker .timepicker-picker").show()},showHours:function(){o.find(".timepicker .timepicker-picker").hide(),o.find(".timepicker .timepicker-hours").show()},showMinutes:function(){o.find(".timepicker .timepicker-picker").hide(),o.find(".timepicke [...]
- * Shows the widget. Possibly will emit dp.show and dp.change
- */
-ga=function(){var b,c={year:function(a){return a.month(0).date(1).hours(0).seconds(0).minutes(0)},month:function(a){return a.date(1).hours(0).seconds(0).minutes(0)},day:function(a){return a.hours(0).seconds(0).minutes(0)},hour:function(a){return a.seconds(0).minutes(0)},minute:function(a){return a.seconds(0)}};// this handles clicks on the widget
-return g.prop("disabled")||!d.ignoreReadonly&&g.prop("readonly")||o?l:(void 0!==g.val()&&0!==g.val().trim().length?aa(da(g.val().trim())):m&&d.useCurrent&&(d.inline||g.is("input")&&0===g.val().trim().length)&&(b=y(),"string"==typeof d.useCurrent&&(b=c[d.useCurrent](b)),aa(b)),o=G(),M(),S(),o.find(".timepicker-hours").hide(),o.find(".timepicker-minutes").hide(),o.find(".timepicker-seconds").hide(),_(),L(),a(window).on("resize",I),o.on("click","[data-action]",fa),o.on("mousedown",!1),n&&n. [...]
- * Shows or hides the widget
- */
-ha=function(){return o?ba():ga()},ia=function(a){var b,c,e,f,g=null,h=[],i={},j=a.which,k="p";w[j]=k;for(b in w)w.hasOwnProperty(b)&&w[b]===k&&(h.push(b),parseInt(b,10)!==j&&(i[b]=!0));for(b in d.keyBinds)if(d.keyBinds.hasOwnProperty(b)&&"function"==typeof d.keyBinds[b]&&(e=b.split(" "),e.length===h.length&&v[j]===e[e.length-1])){for(f=!0,c=e.length-2;c>=0;c--)if(!(v[e[c]]in i)){f=!1;break}if(f){g=d.keyBinds[b];break}}g&&(g.call(l,o),a.stopPropagation(),a.preventDefault())},ja=function(a [...]
-// Store given enabledDates and disabledDates as keys.
-// This way we can check their existence in O(1) time instead of looping through whole array.
-// (for example: options.enabledDates['2014-02-27'] === true)
-var c={};return a.each(b,function(){var a=da(this);a.isValid()&&(c[a.format("YYYY-MM-DD")]=!0)}),Object.keys(c).length?c:!1},oa=function(b){
-// Store given enabledHours and disabledHours as keys.
-// This way we can check their existence in O(1) time instead of looping through whole array.
-// (for example: options.enabledHours['2014-02-27'] === true)
-var c={};return a.each(b,function(){c[this]=!0}),Object.keys(c).length?c:!1},pa=function(){var a=d.format||"L LT";i=a.replace(/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(a){var b=e.localeData().longDateFormat(a)||a;return b.replace(/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(a){//temp fix for #740
-return e.localeData().longDateFormat(a)||a})}),j=d.extraFormats?d.extraFormats.slice():[],j.indexOf(a)<0&&j.indexOf(i)<0&&j.push(i),h=i.toLowerCase().indexOf("a")<1&&i.replace(/\[.*?\]/g,"").indexOf("h")<1,z("y")&&(p=2),z("M")&&(p=1),z("d")&&(p=0),k=Math.max(p,k),m||aa(e)};
-// initializing element and component attributes
-if(/********************************************************************************
- *
- * Public API functions
- * =====================
- *
- * Important: Do not expose direct references to private objects or the options
- * object to the outer world. Always return a clone when returning values or make
- * a clone when setting a private variable.
- *
- ********************************************************************************/
-l.destroy=function(){
-///<summary>Destroys the widget and removes all attached event listeners</summary>
-ba(),ma(),c.removeData("DateTimePicker"),c.removeData("date")},l.toggle=ha,l.show=ga,l.hide=ba,l.disable=function(){
-///<summary>Disables the input element, the component is attached to, by adding a disabled="true" attribute to it.
-///If the widget was visible before that call it is hidden. Possibly emits dp.hide</summary>
-return ba(),n&&n.hasClass("btn")&&n.addClass("disabled"),g.prop("disabled",!0),l},l.enable=function(){
-///<summary>Enables the input element, the component is attached to, by removing disabled attribute from it.</summary>
-return n&&n.hasClass("btn")&&n.removeClass("disabled"),g.prop("disabled",!1),l},l.ignoreReadonly=function(a){if(0===arguments.length)return d.ignoreReadonly;if("boolean"!=typeof a)throw new TypeError("ignoreReadonly () expects a boolean parameter");return d.ignoreReadonly=a,l},l.options=function(b){if(0===arguments.length)return a.extend(!0,{},d);if(!(b instanceof Object))throw new TypeError("options() options parameter should be an object");return a.extend(!0,d,b),a.each(d,function(a,b) [...]
-///<signature helpKeyword="$.fn.datetimepicker.date">
-///<summary>Returns the component's model current date, a moment object or null if not set.</summary>
-///<returns type="Moment">date.clone()</returns>
-///</signature>
-///<signature>
-///<summary>Sets the components model current moment to it. Passing a null value unsets the components model current moment. Parsing of the newDate parameter is made using moment library with the options.format and options.useStrict components configuration.</summary>
-///<param name="newDate" locid="$.fn.datetimepicker.date_p:newDate">Takes string, Date, moment, null parameter.</param>
-///</signature>
-if(0===arguments.length)return m?null:e.clone();if(!(null===a||"string"==typeof a||b.isMoment(a)||a instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");return aa(null===a?null:da(a)),l},l.format=function(a){
-///<summary>test su</summary>
-///<param name="newFormat">info about para</param>
-///<returns type="string|boolean">returns foo</returns>
-if(0===arguments.length)return d.format;if("string"!=typeof a&&("boolean"!=typeof a||a!==!1))throw new TypeError("format() expects a string or boolean:false parameter "+a);return d.format=a,i&&pa(),l},l.timeZone=function(a){if(0===arguments.length)return d.timeZone;if("string"!=typeof a)throw new TypeError("newZone() expects a string parameter");return d.timeZone=a,l},l.dayViewHeaderFormat=function(a){if(0===arguments.length)return d.dayViewHeaderFormat;if("string"!=typeof a)throw new Ty [...]
-///<signature helpKeyword="$.fn.datetimepicker.disabledDates">
-///<summary>Returns an array with the currently set disabled dates on the component.</summary>
-///<returns type="array">options.disabledDates</returns>
-///</signature>
-///<signature>
-///<summary>Setting this takes precedence over options.minDate, options.maxDate configuration. Also calling this function removes the configuration of
-///options.enabledDates if such exist.</summary>
-///<param name="dates" locid="$.fn.datetimepicker.disabledDates_p:dates">Takes an [ string or Date or moment ] of values and allows the user to select only from those days.</param>
-///</signature>
-if(0===arguments.length)return d.disabledDates?a.extend({},d.disabledDates):d.disabledDates;if(!b)return d.disabledDates=!1,_(),l;if(!(b instanceof Array))throw new TypeError("disabledDates() expects an array parameter");return d.disabledDates=na(b),d.enabledDates=!1,_(),l},l.enabledDates=function(b){
-///<signature helpKeyword="$.fn.datetimepicker.enabledDates">
-///<summary>Returns an array with the currently set enabled dates on the component.</summary>
-///<returns type="array">options.enabledDates</returns>
-///</signature>
-///<signature>
-///<summary>Setting this takes precedence over options.minDate, options.maxDate configuration. Also calling this function removes the configuration of options.disabledDates if such exist.</summary>
-///<param name="dates" locid="$.fn.datetimepicker.enabledDates_p:dates">Takes an [ string or Date or moment ] of values and allows the user to select only from those days.</param>
-///</signature>
-if(0===arguments.length)return d.enabledDates?a.extend({},d.enabledDates):d.enabledDates;if(!b)return d.enabledDates=!1,_(),l;if(!(b instanceof Array))throw new TypeError("enabledDates() expects an array parameter");return d.enabledDates=na(b),d.disabledDates=!1,_(),l},l.daysOfWeekDisabled=function(a){if(0===arguments.length)return d.daysOfWeekDisabled.splice(0);if("boolean"==typeof a&&!a)return d.daysOfWeekDisabled=!1,_(),l;if(!(a instanceof Array))throw new TypeError("daysOfWeekDisable [...]
-///<signature helpKeyword="$.fn.datetimepicker.defaultDate">
-///<summary>Returns a moment with the options.defaultDate option configuration or false if not set</summary>
-///<returns type="Moment">date.clone()</returns>
-///</signature>
-///<signature>
-///<summary>Will set the picker's inital date. If a boolean:false value is passed the options.defaultDate parameter is cleared.</summary>
-///<param name="defaultDate" locid="$.fn.datetimepicker.defaultDate_p:defaultDate">Takes a string, Date, moment, boolean:false</param>
-///</signature>
-if(0===arguments.length)return d.defaultDate?d.defaultDate.clone():d.defaultDate;if(!a)return d.defaultDate=!1,l;"string"==typeof a&&(a="now"===a||"moment"===a?y():y(a));var b=da(a);if(!b.isValid())throw new TypeError("defaultDate() Could not parse date parameter: "+a);if(!R(b))throw new TypeError("defaultDate() date passed is invalid according to component setup validations");return d.defaultDate=b,(d.defaultDate&&d.inline||""===g.val().trim())&&aa(d.defaultDate),l},l.locale=function(a) [...]
-///<signature helpKeyword="$.fn.datetimepicker.disabledTimeIntervals">
-///<summary>Returns an array with the currently set disabled dates on the component.</summary>
-///<returns type="array">options.disabledTimeIntervals</returns>
-///</signature>
-///<signature>
-///<summary>Setting this takes precedence over options.minDate, options.maxDate configuration. Also calling this function removes the configuration of
-///options.enabledDates if such exist.</summary>
-///<param name="dates" locid="$.fn.datetimepicker.disabledTimeIntervals_p:dates">Takes an [ string or Date or moment ] of values and allows the user to select only from those days.</param>
-///</signature>
-if(0===arguments.length)return d.disabledTimeIntervals?a.extend({},d.disabledTimeIntervals):d.disabledTimeIntervals;if(!b)return d.disabledTimeIntervals=!1,_(),l;if(!(b instanceof Array))throw new TypeError("disabledTimeIntervals() expects an array parameter");return d.disabledTimeIntervals=b,_(),l},l.disabledHours=function(b){
-///<signature helpKeyword="$.fn.datetimepicker.disabledHours">
-///<summary>Returns an array with the currently set disabled hours on the component.</summary>
-///<returns type="array">options.disabledHours</returns>
-///</signature>
-///<signature>
-///<summary>Setting this takes precedence over options.minDate, options.maxDate configuration. Also calling this function removes the configuration of
-///options.enabledHours if such exist.</summary>
-///<param name="hours" locid="$.fn.datetimepicker.disabledHours_p:hours">Takes an [ int ] of values and disallows the user to select only from those hours.</param>
-///</signature>
-if(0===arguments.length)return d.disabledHours?a.extend({},d.disabledHours):d.disabledHours;if(!b)return d.disabledHours=!1,_(),l;if(!(b instanceof Array))throw new TypeError("disabledHours() expects an array parameter");if(d.disabledHours=oa(b),d.enabledHours=!1,d.useCurrent&&!d.keepInvalid){for(var c=0;!R(e,"h");){if(e.add(1,"h"),24===c)throw"Tried 24 times to find a valid date";c++}aa(e)}return _(),l},l.enabledHours=function(b){
-///<signature helpKeyword="$.fn.datetimepicker.enabledHours">
-///<summary>Returns an array with the currently set enabled hours on the component.</summary>
-///<returns type="array">options.enabledHours</returns>
-///</signature>
-///<signature>
-///<summary>Setting this takes precedence over options.minDate, options.maxDate configuration. Also calling this function removes the configuration of options.disabledHours if such exist.</summary>
-///<param name="hours" locid="$.fn.datetimepicker.enabledHours_p:hours">Takes an [ int ] of values and allows the user to select only from those hours.</param>
-///</signature>
-if(0===arguments.length)return d.enabledHours?a.extend({},d.enabledHours):d.enabledHours;if(!b)return d.enabledHours=!1,_(),l;if(!(b instanceof Array))throw new TypeError("enabledHours() expects an array parameter");if(d.enabledHours=oa(b),d.disabledHours=!1,d.useCurrent&&!d.keepInvalid){for(var c=0;!R(e,"h");){if(e.add(1,"h"),24===c)throw"Tried 24 times to find a valid date";c++}aa(e)}return _(),l},/**
- * Returns the component's model current viewDate, a moment object or null if not set. Passing a null value unsets the components model current moment. Parsing of the newDate parameter is made using moment library with the options.format and options.useStrict components configuration.
- * @param {Takes string, viewDate, moment, null parameter.} newDate
- * @returns {viewDate.clone()}
- */
-l.viewDate=function(a){if(0===arguments.length)return f.clone();if(!a)return f=e.clone(),l;if(!("string"==typeof a||b.isMoment(a)||a instanceof Date))throw new TypeError("viewDate() parameter must be one of [string, moment or Date]");return f=da(a),K(),l},c.is("input"))g=c;else if(g=c.find(d.datepickerInput),0===g.length)g=c.find("input");else if(!g.is("input"))throw new Error('CSS class "'+d.datepickerInput+'" cannot be applied to non input element');if(c.hasClass("input-group")&&(
-// in case there is more then one 'input-group-addon' Issue #48
-n=0===c.find(".datepickerbutton").length?c.find(".input-group-addon"):c.find(".datepickerbutton")),!d.inline&&!g.is("input"))throw new Error("Could not initialize DateTimePicker without an input element");
-// Set defaults for date here now instead of in var declaration
-return e=y(),f=e.clone(),a.extend(!0,d,H()),l.options(d),pa(),la(),g.prop("disabled")&&l.disable(),g.is("input")&&0!==g.val().trim().length?aa(da(g.val().trim())):d.defaultDate&&void 0===g.attr("placeholder")&&aa(d.defaultDate),d.inline&&ga(),l};/********************************************************************************
- *
- * jQuery plugin constructor and defaults object
- *
- ********************************************************************************/
-/**
- * See (http://jquery.com/).
- * @name jQuery
- * @class
- * See the jQuery Library (http://jquery.com/) for full details. This just
- * documents the function and classes that are added to jQuery by this plug-in.
- */
-/**
- * See (http://jquery.com/)
- * @name fn
- * @class
- * See the jQuery Library (http://jquery.com/) for full details. This just
- * documents the function and classes that are added to jQuery by this plug-in.
- * @memberOf jQuery
- */
-/**
- * Show comments
- * @class datetimepicker
- * @memberOf jQuery.fn
- */
-a.fn.datetimepicker=function(b){b=b||{};var d,e=Array.prototype.slice.call(arguments,1),f=!0,g=["destroy","hide","show","toggle"];if("object"==typeof b)return this.each(function(){var d=a(this);d.data("DateTimePicker")||(b=a.extend(!0,{},a.fn.datetimepicker.defaults,b),d.data("DateTimePicker",c(d,b)))});if("string"==typeof b)return this.each(function(){var c=a(this),g=c.data("DateTimePicker");if(!g)throw new Error('bootstrap-datetimepicker("'+b+'") method was called on an element that is [...]
-//tab: function (widget) { //this break the flow of the form. disabling for now
-// var toggle = widget.find('.picker-switch a[data-action="togglePicker"]');
-// if(toggle.length > 0) toggle.click();
-//},
-"control space":function(a){a.find(".timepicker").is(":visible")&&a.find('.btn[data-action="togglePeriod"]').click()},t:function(){this.date(this.getMoment())},"delete":function(){this.clear()}},debug:!1,allowInputToggle:!1,disabledTimeIntervals:!1,disabledHours:!1,enabledHours:!1,viewDate:!1},"undefined"!=typeof module&&(module.exports=a.fn.datetimepicker)});
\ No newline at end of file
+!function(a){"use strict";if("function"==typeof define&&define.amd)define(["jquery","moment"],a);else if("object"==typeof exports)module.exports=a(require("jquery"),require("moment"));else{if("undefined"==typeof jQuery)throw"bootstrap-datetimepicker requires jQuery to be loaded first";if("undefined"==typeof moment)throw"bootstrap-datetimepicker requires Moment.js to be loaded first";a(jQuery,moment)}}(function(a,b){"use strict";if(!b)throw new Error("bootstrap-datetimepicker requires Mom [...]
+return d.keepInvalid=a,l},l.datepickerInput=function(a){if(0===arguments.length)return d.datepickerInput;if("string"!=typeof a)throw new TypeError("datepickerInput() expects a string parameter");return d.datepickerInput=a,l},l.parseInputDate=function(a){if(0===arguments.length)return d.parseInputDate;if("function"!=typeof a)throw new TypeError("parseInputDate() sholud be as function");return d.parseInputDate=a,l},l.disabledTimeIntervals=function(b){if(0===arguments.length)return d.disabl [...]
\ No newline at end of file
diff --git a/component.json b/component.json
index ada02b7..817d7d9 100644
--- a/component.json
+++ b/component.json
@@ -1,6 +1,6 @@
{
"name": "bootstrap-datetimepicker",
- "version": "4.17.42",
+ "version": "4.17.47",
"main": ["build/css/bootstrap-datetimepicker.min.css","build/js/bootstrap-datetimepicker.min.js"],
"dependencies": {
"jquery" : ">=1.8.3",
diff --git a/composer.json b/composer.json
index c50f2b1..6f1f44a 100644
--- a/composer.json
+++ b/composer.json
@@ -1,7 +1,7 @@
{
"name": "eonasdan/bootstrap-datetimepicker",
"type": "component",
- "version": "4.17.42",
+ "version": "4.17.47",
"description": "Date/time picker widget based on twitter bootstrap",
"keywords": [
"bootstrap",
@@ -12,7 +12,7 @@
"require": {
"robloach/component-installer": "*",
"components/jquery": ">=1.9.1",
- "moment": ">=2.10.5"
+ "moment/moment": ">=2.10.5"
},
"extra": {
"component": {
diff --git a/docs/Options.md b/docs/Options.md
index 182315b..17df760 100644
--- a/docs/Options.md
+++ b/docs/Options.md
@@ -206,7 +206,7 @@ Takes a `boolean`. If set to `false` the picker will display similar to `sideByS
### locale
Default: moment.locale()
- Accepts: string, moment.local('locale')
+ Accepts: string, moment.locale('locale')
See [momentjs](https://github.com/moment/moment/tree/develop/locale) for valid locales.
diff --git a/package.json b/package.json
index 8637390..171a372 100644
--- a/package.json
+++ b/package.json
@@ -5,9 +5,15 @@
"bugs": {
"url": "https://github.com/eonasdan/bootstrap-datetimepicker/issues"
},
+ "peerDependencies": {
+ "bootstrap": "^3.3",
+ "jquery": "^1.8.3 || ^2.0 || ^3.0",
+ "moment": "^2.10",
+ "moment-timezone": "^0.4.0"
+ },
"dependencies": {
"bootstrap": "^3.3",
- "jquery": "^1.8.3 || ^2.0",
+ "jquery": "^1.8.3 || ^2.0 || ^3.0",
"moment": "^2.10",
"moment-timezone": "^0.4.0"
},
@@ -41,5 +47,5 @@
"type": "git",
"url": "https://github.com/eonasdan/bootstrap-datetimepicker.git"
},
- "version": "4.17.42"
+ "version": "4.17.47"
}
diff --git a/src/js/bootstrap-datetimepicker.js b/src/js/bootstrap-datetimepicker.js
index 5d2cc71..8838cbc 100644
--- a/src/js/bootstrap-datetimepicker.js
+++ b/src/js/bootstrap-datetimepicker.js
@@ -1,4 +1,4 @@
-/*! version : 4.17.42
+/*! version : 4.17.47
=========================================================
bootstrap-datetimejs
https://github.com/Eonasdan/bootstrap-datetimepicker
@@ -142,6 +142,10 @@
if (d === undefined || d === null) {
returnMoment = moment(); //TODO should this use format? and locale?
+ } else if (moment.isDate(d) || moment.isMoment(d)) {
+ // If the date that is passed in is already a Date() or moment() object,
+ // pass it directly to moment.
+ returnMoment = moment(d);
} else if (hasTimeZone()) { // There is a string to parse and a default time zone
// parse with the tz function which takes a default time zone if it is not in the format string
returnMoment = moment.tz(d, parseFormats, options.useStrict, options.timeZone);
@@ -336,6 +340,7 @@
if (use24Hours) {
template.addClass('usetwentyfour');
}
+
if (isEnabled('s') && !use24Hours) {
template.addClass('wider');
}
@@ -448,15 +453,15 @@
widget.removeClass('pull-right');
}
- // find the first parent element that has a relative css positioning
- if (parent.css('position') !== 'relative') {
+ // find the first parent element that has a non-static css positioning
+ if (parent.css('position') === 'static') {
parent = parent.parents().filter(function () {
- return $(this).css('position') === 'relative';
+ return $(this).css('position') !== 'static';
}).first();
}
if (parent.length === 0) {
- throw new Error('datetimepicker component should be placed within a relative positioned container');
+ throw new Error('datetimepicker component should be placed within a non-static positioned container');
}
widget.css({
@@ -686,7 +691,7 @@
currentDate,
html = [],
row,
- clsName,
+ clsNames = [],
i;
if (!hasDate()) {
@@ -717,26 +722,31 @@
}
html.push(row);
}
- clsName = '';
+ clsNames = ['day'];
if (currentDate.isBefore(viewDate, 'M')) {
- clsName += ' old';
+ clsNames.push('old');
}
if (currentDate.isAfter(viewDate, 'M')) {
- clsName += ' new';
+ clsNames.push('new');
}
if (currentDate.isSame(date, 'd') && !unset) {
- clsName += ' active';
+ clsNames.push('active');
}
if (!isValid(currentDate, 'd')) {
- clsName += ' disabled';
+ clsNames.push('disabled');
}
if (currentDate.isSame(getMoment(), 'd')) {
- clsName += ' today';
+ clsNames.push('today');
}
if (currentDate.day() === 0 || currentDate.day() === 6) {
- clsName += ' weekend';
+ clsNames.push('weekend');
}
- row.append('<td data-action="selectDay" data-day="' + currentDate.format('L') + '" class="day' + clsName + '">' + currentDate.date() + '</td>');
+ notifyEvent({
+ type: 'dp.classify',
+ date: currentDate,
+ classNames: clsNames
+ });
+ row.append('<td data-action="selectDay" data-day="' + currentDate.format('L') + '" class="' + clsNames.join(' ') + '">' + currentDate.date() + '</td>');
currentDate.add(1, 'd');
}
@@ -862,11 +872,15 @@
if (options.stepping !== 1) {
targetMoment.minutes((Math.round(targetMoment.minutes() / options.stepping) * options.stepping)).seconds(0);
+
+ while (options.minDate && targetMoment.isBefore(options.minDate)) {
+ targetMoment.add(options.stepping, 'minutes');
+ }
}
if (isValid(targetMoment)) {
date = targetMoment;
- //viewDate = date.clone(); // TODO this doesn't work right on first use
+ viewDate = date.clone();
input.val(date.format(actualFormat));
element.data('date', date.format(actualFormat));
unset = false;
@@ -933,7 +947,6 @@
input.blur();
- currentViewMode = 0;
viewDate = date.clone();
return picker;
@@ -945,7 +958,7 @@
parseInputDate = function (inputDate) {
if (options.parseInputDate === undefined) {
- if (!moment.isMoment(inputDate)) {
+ if (!moment.isMoment(inputDate) || inputDate instanceof Date) {
inputDate = getMoment(inputDate);
}
} else {
@@ -2402,11 +2415,12 @@
if (typeof options === 'object') {
return this.each(function () {
- var $this = $(this);
+ var $this = $(this),
+ _options;
if (!$this.data('DateTimePicker')) {
// create a private copy of the defaults object
- options = $.extend(true, {}, $.fn.datetimepicker.defaults, options);
- $this.data('DateTimePicker', dateTimePicker($this, options));
+ _options = $.extend(true, {}, $.fn.datetimepicker.defaults, options);
+ $this.data('DateTimePicker', dateTimePicker($this, _options));
}
});
} else if (typeof options === 'string') {
@@ -2617,7 +2631,6 @@
enabledHours: false,
viewDate: false
};
- if (typeof module !== 'undefined') {
- module.exports = $.fn.datetimepicker;
- }
+
+ return $.fn.datetimepicker;
}));
diff --git a/src/less/_bootstrap-datetimepicker.less b/src/less/_bootstrap-datetimepicker.less
index a92cd37..b315172 100644
--- a/src/less/_bootstrap-datetimepicker.less
+++ b/src/less/_bootstrap-datetimepicker.less
@@ -1,6 +1,6 @@
/*!
* Datetimepicker for Bootstrap 3
- * version : 4.17.42
+ * version : 4.17.47
* https://github.com/Eonasdan/bootstrap-datetimepicker/
*/
@bs-datetimepicker-timepicker-font-size: 1.2em;
@@ -19,6 +19,7 @@
list-style: none;
&.dropdown-menu {
+ display: block;
margin: 2px 0;
padding: 4px;
width: 19em;
diff --git a/test/publicApiSpec.js b/test/publicApiSpec.js
index 30573d1..f290c73 100644
--- a/test/publicApiSpec.js
+++ b/test/publicApiSpec.js
@@ -63,13 +63,15 @@ describe('Public API method tests', function () {
dpChangeSpy,
dpShowSpy,
dpHideSpy,
- dpErrorSpy;
+ dpErrorSpy,
+ dpClassifySpy;
beforeEach(function () {
dpChangeSpy = jasmine.createSpy('dp.change event Spy');
dpShowSpy = jasmine.createSpy('dp.show event Spy');
dpHideSpy = jasmine.createSpy('dp.hide event Spy');
dpErrorSpy = jasmine.createSpy('dp.error event Spy');
+ dpClassifySpy = jasmine.createSpy('dp.classify event Spy');
dtpElement = $('<input>').attr('id', 'dtp');
$(document).find('body').append($('<div>').attr('class', 'row').append($('<div>').attr('class', 'col-md-12').append(dtpElement)));
@@ -77,6 +79,7 @@ describe('Public API method tests', function () {
$(document).find('body').on('dp.show', dpShowSpy);
$(document).find('body').on('dp.hide', dpHideSpy);
$(document).find('body').on('dp.error', dpErrorSpy);
+ $(document).find('body').on('dp.classify', dpClassifySpy);
dtpElement.datetimepicker();
dtp = dtpElement.data('DateTimePicker');
@@ -290,10 +293,29 @@ describe('Public API method tests', function () {
expect(dpShowSpy).not.toHaveBeenCalled();
});
+ it('calls the classify event for each day that is shown', function () {
+ dtp.show();
+ expect(dpClassifySpy.calls.count()).toEqual(42);
+ });
+
it('actually shows the widget', function () {
dtp.show();
expect($(document).find('body').find('.bootstrap-datetimepicker-widget').length).toEqual(1);
});
+
+ it('applies the styles appended in the classify event handler', function () {
+ var handler = function (event) {
+ if (event.date.get('weekday') === 4) {
+ event.classNames.push('humpday');
+ }
+ event.classNames.push('injected');
+ };
+ $(document).find('body').on('dp.classify', handler);
+ dtp.show();
+ $(document).find('body').off('dp.classify', handler);
+ expect($(document).find('body').find('.bootstrap-datetimepicker-widget td.day.injected').length).toEqual(42);
+ expect($(document).find('body').find('.bootstrap-datetimepicker-widget td.day.humpday').length).toEqual(6);
+ });
});
describe('access', function () {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/eonasdan-bootstrap-datetimepicker.git
More information about the Pkg-javascript-commits
mailing list