bootstrap3-datetimepicker-rails 2.1.20 → 2.1.20.1
Sign up to get free protection for your applications and to get access to all the features.
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# bootstrap3-datetimepicker-rails
|
2
2
|
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/bootstrap3-datetimepicker-rails.png)](http://badge.fury.io/rb/bootstrap3-datetimepicker-rails)
|
4
|
+
|
3
5
|
This gem packages the [bootstrap-datetimepicker](https://github.com/Eonasdan/bootstrap-datetimepicker) for the Rails 3.1+ asset pipeline.
|
4
6
|
|
5
7
|
Eonasdan's fork of tarruda's [bootstrap-datetimepicker](https://github.com/tarruda/bootstrap-datetimepicker) is
|
@@ -42,13 +42,13 @@
|
|
42
42
|
}
|
43
43
|
|
44
44
|
(function ($, moment) {
|
45
|
-
if (typeof moment === 'undefined') {
|
45
|
+
if (typeof moment === 'undefined') {
|
46
46
|
alert("momentjs is requried");
|
47
|
-
throw new Error('momentjs is
|
47
|
+
throw new Error('momentjs is requried');
|
48
48
|
};
|
49
|
-
|
49
|
+
|
50
50
|
var dpgId = 0,
|
51
|
-
|
51
|
+
|
52
52
|
pMoment = moment,
|
53
53
|
|
54
54
|
// ReSharper disable once InconsistentNaming
|
@@ -62,7 +62,7 @@
|
|
62
62
|
startDate: new pMoment({ y: 1970 }),
|
63
63
|
endDate: new pMoment().add(50, "y"),
|
64
64
|
collapse: true,
|
65
|
-
language:
|
65
|
+
language: "en",
|
66
66
|
defaultDate: "",
|
67
67
|
disabledDates: [],
|
68
68
|
enabledDates: false,
|
@@ -84,11 +84,11 @@
|
|
84
84
|
var icon = false, i, dDate, longDateFormat;
|
85
85
|
picker.options = $.extend({}, defaults, options);
|
86
86
|
picker.options.icons = $.extend({}, icons, picker.options.icons);
|
87
|
-
|
87
|
+
|
88
88
|
picker.element = $(element);
|
89
|
-
|
89
|
+
|
90
90
|
dataToOptions();
|
91
|
-
|
91
|
+
|
92
92
|
if (!(picker.options.pickTime || picker.options.pickDate))
|
93
93
|
throw new Error('Must choose at least one picker');
|
94
94
|
|
@@ -201,7 +201,7 @@
|
|
201
201
|
attachDatePickerEvents();
|
202
202
|
if (picker.options.defaultDate !== "") picker.setValue(picker.options.defaultDate);
|
203
203
|
},
|
204
|
-
|
204
|
+
|
205
205
|
dataToOptions = function () {
|
206
206
|
var eData = picker.element.data();
|
207
207
|
if (eData.pickdate !== undefined) picker.options.pickDate = eData.pickdate;
|
@@ -266,7 +266,7 @@
|
|
266
266
|
date: pMoment(picker.date),
|
267
267
|
oldDate: pMoment(oldDate)
|
268
268
|
});
|
269
|
-
|
269
|
+
|
270
270
|
if (eventType !== 'change')
|
271
271
|
picker.element.change();
|
272
272
|
},
|
@@ -452,7 +452,7 @@
|
|
452
452
|
}
|
453
453
|
table.html(html);
|
454
454
|
},
|
455
|
-
|
455
|
+
|
456
456
|
fillSeconds = function () {
|
457
457
|
var table = picker.widget.find('.timepicker .timepicker-seconds table'), html = '', current = 0, i, j;
|
458
458
|
table.parent().hide();
|
@@ -641,7 +641,7 @@
|
|
641
641
|
if (!picker.date) picker.date = pMoment({ y: 1970 });
|
642
642
|
set();
|
643
643
|
fillTime();
|
644
|
-
notifyChange(oldDate
|
644
|
+
notifyChange(oldDate);
|
645
645
|
return rv;
|
646
646
|
},
|
647
647
|
|
@@ -656,13 +656,13 @@
|
|
656
656
|
if (d.isValid()) {
|
657
657
|
update();
|
658
658
|
picker.setValue(d);
|
659
|
-
notifyChange(oldDate
|
659
|
+
notifyChange(oldDate);
|
660
660
|
set();
|
661
661
|
}
|
662
662
|
else {
|
663
663
|
picker.viewDate = oldDate;
|
664
664
|
//picker.setValue(""); // unset the date when the input is erased
|
665
|
-
notifyChange(oldDate
|
665
|
+
notifyChange(oldDate);
|
666
666
|
notifyError(d);
|
667
667
|
picker.unset = true;
|
668
668
|
input.val('');
|
@@ -1055,7 +1055,7 @@
|
|
1055
1055
|
else picker.options.enabledDates = dates;
|
1056
1056
|
if (picker.viewDate) update();
|
1057
1057
|
},
|
1058
|
-
|
1058
|
+
|
1059
1059
|
picker.setEndDate = function (date) {
|
1060
1060
|
picker.options.endDate = pMoment(date);
|
1061
1061
|
if (!picker.options.endDate.isValid()) {
|
@@ -1081,4 +1081,4 @@
|
|
1081
1081
|
if (!data) $this.data('DateTimePicker', new DateTimePicker(this, options));
|
1082
1082
|
});
|
1083
1083
|
};
|
1084
|
-
}));
|
1084
|
+
}));
|
@@ -25,4 +25,4 @@
|
|
25
25
|
* limitations under the License.
|
26
26
|
* =========================================================
|
27
27
|
*/
|
28
|
-
(function(a){if(typeof define==="function"&&define.amd){define(["jquery","moment"],a)}else{if(!jQuery){throw"bootstrap-datetimepicker requires jQuery to be loaded first"}else{if(!moment){throw"bootstrap-datetimepicker requires moment.js to be loaded first"}else{a(jQuery,moment)}}}}(function(d,e){if(typeof e==="undefined"){alert("momentjs is requried");throw new Error("momentjs is requried")}var c=0,a=e,b=function(o,q){var z={pickDate:true,pickTime:true,useMinutes:true,useSeconds:false,minuteStepping:1,startDate:new a({y:1970}),endDate:new a().add(50,"y"),collapse:true,language:"en",defaultDate:"",disabledDates:[],enabledDates:false,icons:{},useStrict:false},M={time:"glyphicon glyphicon-time",date:"glyphicon glyphicon-calendar",up:"glyphicon glyphicon-chevron-up",down:"glyphicon glyphicon-chevron-down"},l=this,I=function(){var S=false,R,T,Q;l.options=d.extend({},z,q);l.options.icons=d.extend({},M,l.options.icons);l.element=d(o);f();if(!(l.options.pickTime||l.options.pickDate)){throw new Error("Must choose at least one picker")}l.id=c++;a.lang(l.options.language);l.date=a();l.unset=false;l.isInput=l.element.is("input");l.component=false;if(l.element.hasClass("input-group")){if(l.element.find(".datepickerbutton").size()==0){l.component=l.element.find("[class^='input-group-']")}else{l.component=l.element.find(".datepickerbutton")}}l.format=l.options.format;Q=a()._lang._longDateFormat;if(!l.format){if(l.isInput){l.format=l.element.data("format")}else{l.format=l.element.find("input").data("format")}if(!l.format){l.format=(l.options.pickDate?Q.L:"");if(l.options.pickDate&&l.options.pickTime){l.format+=" "}l.format+=(l.options.pickTime?Q.LT:"");if(l.options.useSeconds){if(~Q.LT.indexOf(" A")){l.format=l.format.split(" A")[0]+":ss A"}else{l.format+=":ss"}}}}l.options.use24hours=l.format.toLowerCase().indexOf("a")<1;if(l.component){S=l.component.find("span")}if(l.options.pickTime){if(S){S.addClass(l.options.icons.time)}}if(l.options.pickDate){if(S){S.removeClass(l.options.icons.time);S.addClass(l.options.icons.date)}}l.widget=d(P(l.options.pickDate,l.options.pickTime,l.options.collapse)).appendTo("body");l.minViewMode=l.options.minViewMode||l.element.data("date-minviewmode")||0;if(typeof l.minViewMode==="string"){switch(l.minViewMode){case"months":l.minViewMode=1;break;case"years":l.minViewMode=2;break;default:l.minViewMode=0;break}}l.viewMode=l.options.viewMode||l.element.data("date-viewmode")||0;if(typeof l.viewMode==="string"){switch(l.viewMode){case"months":l.viewMode=1;break;case"years":l.viewMode=2;break;default:l.viewMode=0;break}}for(R=0;R<l.options.disabledDates.length;R++){T=l.options.disabledDates[R];T=a(T);if(!T.isValid()){T=a(l.options.startDate).subtract(1,"day")}l.options.disabledDates[R]=T.format("L")}for(R=0;R<l.options.enabledDates.length;R++){T=l.options.enabledDates[R];T=a(T);if(!T.isValid()){T=a(l.options.startDate).subtract(1,"day")}l.options.enabledDates[R]=T.format("L")}l.startViewMode=l.viewMode;l.setStartDate(l.options.startDate||l.element.data("date-startdate"));l.setEndDate(l.options.endDate||l.element.data("date-enddate"));H();u();v();t();h();y();g();J();if(l.options.defaultDate!==""){l.setValue(l.options.defaultDate)}},f=function(){var Q=l.element.data();if(Q.pickdate!==undefined){l.options.pickDate=Q.pickdate}if(Q.picktime!==undefined){l.options.pickTime=Q.picktime}if(Q.useminutes!==undefined){l.options.useMinutes=Q.useminutes}if(Q.useseconds!==undefined){l.options.useSeconds=Q.useseconds}if(Q.minutestepping!==undefined){l.options.minuteStepping=Q.minutestepping}if(Q.startdate!==undefined){l.options.startDate=Q.startdate}if(Q.enddate!==undefined){l.options.endDate=Q.enddate}if(Q.collapse!==undefined){l.options.collapse=Q.collapse}if(Q.language!==undefined){l.options.language=Q.language}if(Q.defaultdate!==undefined){l.options.defaultDate=Q.defaultdate}if(Q.disableddates!==undefined){l.options.disabledDates=Q.disableddates}if(Q.enableddates!==undefined){l.options.enabledDates=Q.enableddates}if(Q.icons!==undefined){l.options.icons=Q.icons}if(Q.usestrict!==undefined){l.options.useStrict=Q.usestrict}},j=function(){var Q="absolute",S=l.component?l.component.offset():l.element.offset(),R=d(window);l.width=l.component?l.component.outerWidth():l.element.outerWidth();S.top=S.top+l.element.outerHeight();if(l.options.width!==undefined){l.widget.width(l.options.width)}if(l.options.orientation==="left"){l.widget.addClass("left-oriented");S.left=S.left-l.widget.width()+20}if(B()){Q="fixed";S.top-=R.scrollTop();S.left-=R.scrollLeft()}if(R.width()<S.left+l.widget.outerWidth()){S.right=R.width()-S.left-l.width;S.left="auto";l.widget.addClass("pull-right")}else{S.right="auto";l.widget.removeClass("pull-right")}l.widget.css({position:Q,top:S.top,left:S.left,right:S.right})},p=function(R,Q){l.element.trigger({type:"change.dp",date:a(l.date),oldDate:a(R)});if(Q!=="change"){l.element.change()}},C=function(Q){l.element.trigger({type:"error.dp",date:a(Q)})},y=function(Q){a.lang(l.options.language);var R=Q;if(!R){if(l.isInput){R=l.element.val()}else{R=l.element.find("input").val()}if(R){l.date=a(R,l.format,l.options.useStrict)}if(!l.date){l.date=a()}}l.viewDate=a(l.date).startOf("month");n();k()},H=function(){a.lang(l.options.language);var S=d("<tr>"),Q=a.weekdaysMin(),R;if(a()._lang._week.dow==0){for(R=0;R<7;R++){S.append('<th class="dow">'+Q[R]+"</th>")}}else{for(R=1;R<8;R++){if(R==7){S.append('<th class="dow">'+Q[0]+"</th>")}else{S.append('<th class="dow">'+Q[R]+"</th>")}}}l.widget.find(".datepicker-days thead").append(S)},u=function(){a.lang(l.options.language);var R="",Q=0,S=a.monthsShort();while(Q<12){R+='<span class="month">'+S[Q++]+"</span>"}l.widget.find(".datepicker-months td").append(R)},n=function(){a.lang(l.options.language);var ab=l.viewDate.year(),Z=l.viewDate.month(),aa=l.options.startDate.year(),ad=l.options.startDate.month(),ae=l.options.endDate.year(),X=l.options.endDate.month(),T,W,V=[],af,S,U,ac,R,Y,Q=a.months();l.widget.find(".datepicker-days").find(".disabled").removeClass("disabled");l.widget.find(".datepicker-months").find(".disabled").removeClass("disabled");l.widget.find(".datepicker-years").find(".disabled").removeClass("disabled");l.widget.find(".datepicker-days th:eq(1)").text(Q[Z]+" "+ab);T=a(l.viewDate).subtract("months",1);ac=T.daysInMonth();T.date(ac).startOf("week");if((ab==aa&&Z<=ad)||ab<aa){l.widget.find(".datepicker-days th:eq(0)").addClass("disabled")}if((ab==ae&&Z>=X)||ab>ae){l.widget.find(".datepicker-days th:eq(2)").addClass("disabled")}W=a(T).add(42,"d");while(T.isBefore(W)){if(T.weekday()===a().startOf("week").weekday()){af=d("<tr>");V.push(af)}S="";if(T.year()<ab||(T.year()==ab&&T.month()<Z)){S+=" old"}else{if(T.year()>ab||(T.year()==ab&&T.month()>Z)){S+=" new"}}if(T.isSame(a({y:l.date.year(),M:l.date.month(),d:l.date.date()}))){S+=" active"}if((a(T).add(1,"d")<=l.options.startDate)||(T>l.options.endDate)||O(T)||!s(T)){S+=" disabled"}af.append('<td class="day'+S+'">'+T.date()+"</td>");T.add(1,"d")}l.widget.find(".datepicker-days tbody").empty().append(V);Y=a().year(),Q=l.widget.find(".datepicker-months").find("th:eq(1)").text(ab).end().find("span").removeClass("active");if(Y===ab){Q.eq(a().month()).addClass("active")}if(Y-1<aa){l.widget.find(".datepicker-months th:eq(0)").addClass("disabled")}if(Y+1>ae){l.widget.find(".datepicker-months th:eq(2)").addClass("disabled")}for(U=0;U<12;U++){if((ab==aa&&ad>U)||(ab<aa)){d(Q[U]).addClass("disabled")}else{if((ab==ae&&X<U)||(ab>ae)){d(Q[U]).addClass("disabled")}}}V="";ab=parseInt(ab/10,10)*10;R=l.widget.find(".datepicker-years").find("th:eq(1)").text(ab+"-"+(ab+9)).end().find("td");l.widget.find(".datepicker-years").find("th").removeClass("disabled");if(aa>ab){l.widget.find(".datepicker-years").find("th:eq(0)").addClass("disabled")}if(ae<ab+9){l.widget.find(".datepicker-years").find("th:eq(2)").addClass("disabled")}ab-=1;for(U=-1;U<11;U++){V+='<span class="year'+(U===-1||U===10?" old":"")+(Y===ab?" active":"")+((ab<aa||ab>ae)?" disabled":"")+'">'+ab+"</span>";ab+=1}R.html(V)},v=function(){a.lang(l.options.language);var T=l.widget.find(".timepicker .timepicker-hours table"),S="",U,R,Q;T.parent().hide();if(l.options.use24hours){U=0;for(R=0;R<6;R+=1){S+="<tr>";for(Q=0;Q<4;Q+=1){S+='<td class="hour">'+N(U.toString())+"</td>";U++}S+="</tr>"}}else{U=1;for(R=0;R<3;R+=1){S+="<tr>";for(Q=0;Q<4;Q+=1){S+='<td class="hour">'+N(U.toString())+"</td>";U++}S+="</tr>"}}T.html(S)},t=function(){var T=l.widget.find(".timepicker .timepicker-minutes table"),S="",U=0,R,Q;T.parent().hide();for(R=0;R<5;R++){S+="<tr>";for(Q=0;Q<4;Q+=1){S+='<td class="minute">'+N(U.toString())+"</td>";U+=3}S+="</tr>"}T.html(S)},h=function(){var T=l.widget.find(".timepicker .timepicker-seconds table"),S="",U=0,R,Q;T.parent().hide();for(R=0;R<5;R++){S+="<tr>";for(Q=0;Q<4;Q+=1){S+='<td class="second">'+N(U.toString())+"</td>";U+=3}S+="</tr>"}T.html(S)},k=function(){if(!l.date){return}var S=l.widget.find(".timepicker span[data-time-component]"),Q=l.date.hours(),R="AM";if(!l.options.use24hours){if(Q>=12){R="PM"}if(Q===0){Q=12}else{if(Q!=12){Q=Q%12}}l.widget.find(".timepicker [data-action=togglePeriod]").text(R)}S.filter("[data-time-component=hours]").text(N(Q));S.filter("[data-time-component=minutes]").text(N(l.date.minutes()));S.filter("[data-time-component=seconds]").text(N(l.date.second()))},A=function(W){W.stopPropagation();W.preventDefault();l.unset=false;var V=d(W.target).closest("span, td, th"),U,S,T,Q,R=a(l.date);if(V.length===1){if(!V.is(".disabled")){switch(V[0].nodeName.toLowerCase()){case"th":switch(V[0].className){case"switch":g(1);break;case"prev":case"next":T=w.modes[l.viewMode].navStep;if(V[0].className==="prev"){T=T*-1}l.viewDate.add(T,w.modes[l.viewMode].navFnc);n();break}break;case"span":if(V.is(".month")){U=V.parent().find("span").index(V);l.viewDate.month(U)}else{S=parseInt(V.text(),10)||0;l.viewDate.year(S)}if(l.viewMode!==0){l.date=a({y:l.viewDate.year(),M:l.viewDate.month(),d:l.viewDate.date(),h:l.date.hours(),m:l.date.minutes()});p(R,W.type)}g(-1);n();break;case"td":if(V.is(".day")){Q=parseInt(V.text(),10)||1;U=l.viewDate.month();S=l.viewDate.year();if(V.is(".old")){if(U===0){U=11;S-=1}else{U-=1}}else{if(V.is(".new")){if(U==11){U=0;S+=1}else{U+=1}}}l.date=a({y:S,M:U,d:Q,h:l.date.hours(),m:l.date.minutes()});l.viewDate=a({y:S,M:U,d:Math.min(28,Q)});n();r();p(R,W.type)}break}}}},D={incrementHours:function(){m("add","hours",1)},incrementMinutes:function(){m("add","minutes",l.options.minuteStepping)},incrementSeconds:function(){m("add","seconds",1)},decrementHours:function(){m("subtract","hours",1)},decrementMinutes:function(){m("subtract","minutes",l.options.minuteStepping)},decrementSeconds:function(){m("subtract","seconds",1)},togglePeriod:function(){var Q=l.date.hours();if(Q>=12){Q-=12}else{Q+=12}l.date.hours(Q)},showPicker:function(){l.widget.find(".timepicker > div:not(.timepicker-picker)").hide();l.widget.find(".timepicker .timepicker-picker").show()},showHours:function(){l.widget.find(".timepicker .timepicker-picker").hide();l.widget.find(".timepicker .timepicker-hours").show()},showMinutes:function(){l.widget.find(".timepicker .timepicker-picker").hide();l.widget.find(".timepicker .timepicker-minutes").show()},showSeconds:function(){l.widget.find(".timepicker .timepicker-picker").hide();l.widget.find(".timepicker .timepicker-seconds").show()},selectHour:function(Q){l.date.hours(parseInt(d(Q.target).text(),10));D.showPicker.call(l)},selectMinute:function(Q){l.date.minutes(parseInt(d(Q.target).text(),10));D.showPicker.call(l)},selectSecond:function(Q){l.date.seconds(parseInt(d(Q.target).text(),10));D.showPicker.call(l)}},x=function(S){var Q=a(l.date),R=d(S.currentTarget).data("action"),T=D[R].apply(l,arguments);K(S);if(!l.date){l.date=a({y:1970})}r();k();p(Q,S.type);return T},K=function(Q){Q.stopPropagation();Q.preventDefault()},i=function(S){a.lang(l.options.language);var Q=d(S.target),R=a(l.date),T=a(Q.val(),l.format,l.options.useStrict);if(T.isValid()){y();l.setValue(T);p(R,S.type);r()}else{l.viewDate=R;p(R,S.type);C(T);l.unset=true;Q.val("")}},g=function(Q){if(Q){l.viewMode=Math.max(l.minViewMode,Math.min(2,l.viewMode+Q))}l.widget.find(".datepicker > div").hide().filter(".datepicker-"+w.modes[l.viewMode].clsName).show()},J=function(){var U,T,R,Q,S;l.widget.on("click",".datepicker *",d.proxy(A,this));l.widget.on("click","[data-action]",d.proxy(x,this));l.widget.on("mousedown",d.proxy(K,this));if(l.options.pickDate&&l.options.pickTime){l.widget.on("click.togglePicker",".accordion-toggle",function(V){V.stopPropagation();U=d(this);T=U.closest("ul");R=T.find(".in");Q=T.find(".collapse:not(.in)");if(R&&R.length){S=R.data("collapse");if(S&&S.transitioning){return}R.collapse("hide");Q.collapse("show");U.find("span").toggleClass(l.options.icons.time+" "+l.options.icons.date);l.element.find(".input-group-addon span").toggleClass(l.options.icons.time+" "+l.options.icons.date)}})}if(l.isInput){l.element.on({focus:d.proxy(l.show,this),change:d.proxy(i,this),blur:d.proxy(l.hide,this)})}else{l.element.on({change:d.proxy(i,this)},"input");if(l.component){l.component.on("click",d.proxy(l.show,this))}else{l.element.on("click",d.proxy(l.show,this))}}},L=function(){d(window).on("resize.datetimepicker"+l.id,d.proxy(j,this));if(!l.isInput){d(document).on("mousedown.datetimepicker"+l.id,d.proxy(l.hide,this))}},F=function(){l.widget.off("click",".datepicker *",l.click);l.widget.off("click","[data-action]");l.widget.off("mousedown",l.stopEvent);if(l.options.pickDate&&l.options.pickTime){l.widget.off("click.togglePicker")}if(l.isInput){l.element.off({focus:l.show,change:l.change})}else{l.element.off({change:l.change},"input");if(l.component){l.component.off("click",l.show)}else{l.element.off("click",l.show)}}},E=function(){d(window).off("resize.datetimepicker"+l.id);if(!l.isInput){d(document).off("mousedown.datetimepicker"+l.id)}},B=function(){if(l.element){var R=l.element.parents(),Q=false,S;for(S=0;S<R.length;S++){if(d(R[S]).css("position")=="fixed"){Q=true;break}}return Q}else{return false}},r=function(){a.lang(l.options.language);var R="",Q;if(!l.unset){R=a(l.date).format(l.format)}if(!l.isInput){if(l.component){Q=l.element.find("input");Q.val(R)}l.element.data("date",R)}else{l.element.val(R)}if(!l.options.pickTime){l.hide()}},m=function(T,S,R){a.lang(l.options.language);var Q;if(T=="add"){Q=a(l.date);if(Q.hours()==23){Q.add(R,S)}Q.add(R,S)}else{Q=a(l.date).subtract(R,S)}if(Q.isAfter(l.options.endDate)||a(Q.subtract(R,S)).isBefore(l.options.startDate)||O(Q)){C(Q.format(l.format));return}if(T=="add"){l.date.add(R,S)}else{l.date.subtract(R,S)}},O=function(Q){a.lang(l.options.language);var S=l.options.disabledDates,R;for(R in S){if(S[R]==a(Q).format("L")){return true}}return false},s=function(R){a.lang(l.options.language);var Q=l.options.enabledDates,S;if(Q.length){for(S in Q){if(Q[S]==a(R).format("L")){return true}}return false}return Q===false?true:false},N=function(Q){Q=Q.toString();if(Q.length>=2){return Q}else{return"0"+Q}},P=function(R,Q,S){if(R&&Q){return('<div class="bootstrap-datetimepicker-widget dropdown-menu" style="z-index:9999 !important;"><ul class="list-unstyled"><li'+(S?' class="collapse in"':"")+'><div class="datepicker">'+w.template+'</div></li><li class="picker-switch accordion-toggle"><a class="btn" style="width:100%"><span class="'+l.options.icons.time+'"></span></a></li><li'+(S?' class="collapse"':"")+'><div class="timepicker">'+G.getTemplate()+"</div></li></ul></div>")}else{if(Q){return('<div class="bootstrap-datetimepicker-widget dropdown-menu"><div class="timepicker">'+G.getTemplate()+"</div></div>")}else{return('<div class="bootstrap-datetimepicker-widget dropdown-menu"><div class="datepicker">'+w.template+"</div></div>")}}},w={modes:[{clsName:"days",navFnc:"month",navStep:1},{clsName:"months",navFnc:"year",navStep:1},{clsName:"years",navFnc:"year",navStep:10}],headTemplate:'<thead><tr><th class="prev">‹</th><th colspan="5" class="switch"></th><th class="next">›</th></tr></thead>',contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>'},G={hourTemplate:'<span data-action="showHours" data-time-component="hours" class="timepicker-hour"></span>',minuteTemplate:'<span data-action="showMinutes" data-time-component="minutes" class="timepicker-minute"></span>',secondTemplate:'<span data-action="showSeconds" data-time-component="seconds" class="timepicker-second"></span>'};w.template='<div class="datepicker-days"><table class="table-condensed">'+w.headTemplate+'<tbody></tbody></table></div><div class="datepicker-months"><table class="table-condensed">'+w.headTemplate+w.contTemplate+'</table></div><div class="datepicker-years"><table class="table-condensed">'+w.headTemplate+w.contTemplate+"</table></div>";G.getTemplate=function(){return('<div class="timepicker-picker"><table class="table-condensed"><tr><td><a href="#" class="btn" data-action="incrementHours"><span class="'+l.options.icons.up+'"></span></a></td><td class="separator"></td><td>'+(l.options.useMinutes?'<a href="#" class="btn" data-action="incrementMinutes"><span class="'+l.options.icons.up+'"></span></a>':"")+"</td>"+(l.options.useSeconds?'<td class="separator"></td><td><a href="#" class="btn" data-action="incrementSeconds"><span class="'+l.options.icons.up+'"></span></a></td>':"")+(l.options.use24hours?"":'<td class="separator"></td>')+"</tr><tr><td>"+G.hourTemplate+'</td> <td class="separator">:</td><td>'+(l.options.useMinutes?G.minuteTemplate:'<span class="timepicker-minute">00</span>')+"</td> "+(l.options.useSeconds?'<td class="separator">:</td><td>'+G.secondTemplate+"</td>":"")+(l.options.use24hours?"":'<td class="separator"></td><td><button type="button" class="btn btn-primary" data-action="togglePeriod"></button></td>')+'</tr><tr><td><a href="#" class="btn" data-action="decrementHours"><span class="'+l.options.icons.down+'"></span></a></td><td class="separator"></td><td>'+(l.options.useMinutes?'<a href="#" class="btn" data-action="decrementMinutes"><span class="'+l.options.icons.down+'"></span></a>':"")+"</td>"+(l.options.useSeconds?'<td class="separator"></td><td><a href="#" class="btn" data-action="decrementSeconds"><span class="'+l.options.icons.down+'"></span></a></td>':"")+(l.options.use24hours?"":'<td class="separator"></td>')+'</tr></table></div><div class="timepicker-hours" data-action="selectHour"><table class="table-condensed"></table></div><div class="timepicker-minutes" data-action="selectMinute"><table class="table-condensed"></table></div>'+(l.options.useSeconds?'<div class="timepicker-seconds" data-action="selectSecond"><table class="table-condensed"></table></div>':""))};l.destroy=function(){F();E();l.widget.remove();l.element.removeData("DateTimePicker");if(l.component){l.component.removeData("DateTimePicker")}};l.show=function(Q){l.widget.show();l.height=l.component?l.component.outerHeight():l.element.outerHeight();j();l.element.trigger({type:"show.dp",date:a(l.date)});L();if(Q){K(Q)}},l.disable=function(){var Q=l.element.find("input");if(!Q.prop("disabled")){return}Q.prop("disabled",true);F()},l.enable=function(){var Q=l.element.find("input");if(!Q.prop("disabled")){return}Q.prop("disabled",true);J()},l.hide=function(S){if(S&&d(S.target).is(l.element.attr("id"))){return}var T=l.widget.find(".collapse"),Q,R;for(Q=0;Q<T.length;Q++){R=T.eq(Q).data("collapse");if(R&&R.transitioning){return}}l.widget.hide();l.viewMode=l.startViewMode;g();l.element.trigger({type:"hide.dp",date:a(l.date)});E()},l.setValue=function(Q){a.lang(l.options.language);if(!Q){l.unset=true}else{l.unset=false}if(!a.isMoment(Q)){Q=a(Q)}if(Q.isValid()){l.date=Q;r();l.viewDate=a({y:l.date.year(),M:l.date.month()});n();k()}else{C(Q)}},l.getDate=function(){if(l.unset){return null}return l.date},l.setDate=function(Q){Q=a(Q);if(!Q){l.setValue(null)}else{l.setValue(Q)}},l.setEnabledDates=function(Q){if(!Q){l.options.enabledDates=false}else{l.options.enabledDates=Q}if(l.viewDate){y()}},l.setEndDate=function(Q){l.options.endDate=a(Q);if(!l.options.endDate.isValid()){l.options.endDate=a().add(50,"y")}if(l.viewDate){y()}},l.setStartDate=function(Q){l.options.startDate=a(Q);if(!l.options.startDate.isValid()){l.options.startDate=a({y:1970})}if(l.viewDate){y()}};I()};d.fn.datetimepicker=function(f){return this.each(function(){var h=d(this),g=h.data("DateTimePicker");if(!g){h.data("DateTimePicker",new b(this,f))}})}}));
|
28
|
+
(function(a){if(typeof define==="function"&&define.amd){define(["jquery","moment"],a)}else{if(!jQuery){throw"bootstrap-datetimepicker requires jQuery to be loaded first"}else{if(!moment){throw"bootstrap-datetimepicker requires moment.js to be loaded first"}else{a(jQuery,moment)}}}}(function(d,e){if(typeof e==="undefined"){alert("momentjs is requried");throw new Error("momentjs is requried")}var c=0,a=e,b=function(o,q){var z={pickDate:true,pickTime:true,useMinutes:true,useSeconds:false,minuteStepping:1,startDate:new a({y:1970}),endDate:new a().add(50,"y"),collapse:true,language:"en",defaultDate:"",disabledDates:[],enabledDates:false,icons:{},useStrict:false},M={time:"glyphicon glyphicon-time",date:"glyphicon glyphicon-calendar",up:"glyphicon glyphicon-chevron-up",down:"glyphicon glyphicon-chevron-down"},l=this,I=function(){var S=false,R,T,Q;l.options=d.extend({},z,q);l.options.icons=d.extend({},M,l.options.icons);l.element=d(o);f();if(!(l.options.pickTime||l.options.pickDate)){throw new Error("Must choose at least one picker")}l.id=c++;a.lang(l.options.language);l.date=a();l.unset=false;l.isInput=l.element.is("input");l.component=false;if(l.element.hasClass("input-group")){if(l.element.find(".datepickerbutton").size()==0){l.component=l.element.find("[class^='input-group-']")}else{l.component=l.element.find(".datepickerbutton")}}l.format=l.options.format;Q=a()._lang._longDateFormat;if(!l.format){if(l.isInput){l.format=l.element.data("format")}else{l.format=l.element.find("input").data("format")}if(!l.format){l.format=(l.options.pickDate?Q.L:"");if(l.options.pickDate&&l.options.pickTime){l.format+=" "}l.format+=(l.options.pickTime?Q.LT:"");if(l.options.useSeconds){if(~Q.LT.indexOf(" A")){l.format=l.format.split(" A")[0]+":ss A"}else{l.format+=":ss"}}}}l.options.use24hours=l.format.toLowerCase().indexOf("a")<1;if(l.component){S=l.component.find("span")}if(l.options.pickTime){if(S){S.addClass(l.options.icons.time)}}if(l.options.pickDate){if(S){S.removeClass(l.options.icons.time);S.addClass(l.options.icons.date)}}l.widget=d(P(l.options.pickDate,l.options.pickTime,l.options.collapse)).appendTo("body");l.minViewMode=l.options.minViewMode||l.element.data("date-minviewmode")||0;if(typeof l.minViewMode==="string"){switch(l.minViewMode){case"months":l.minViewMode=1;break;case"years":l.minViewMode=2;break;default:l.minViewMode=0;break}}l.viewMode=l.options.viewMode||l.element.data("date-viewmode")||0;if(typeof l.viewMode==="string"){switch(l.viewMode){case"months":l.viewMode=1;break;case"years":l.viewMode=2;break;default:l.viewMode=0;break}}for(R=0;R<l.options.disabledDates.length;R++){T=l.options.disabledDates[R];T=a(T);if(!T.isValid()){T=a(l.options.startDate).subtract(1,"day")}l.options.disabledDates[R]=T.format("L")}for(R=0;R<l.options.enabledDates.length;R++){T=l.options.enabledDates[R];T=a(T);if(!T.isValid()){T=a(l.options.startDate).subtract(1,"day")}l.options.enabledDates[R]=T.format("L")}l.startViewMode=l.viewMode;l.setStartDate(l.options.startDate||l.element.data("date-startdate"));l.setEndDate(l.options.endDate||l.element.data("date-enddate"));H();u();v();t();h();y();g();J();if(l.options.defaultDate!==""){l.setValue(l.options.defaultDate)}},f=function(){var Q=l.element.data();if(Q.pickdate!==undefined){l.options.pickDate=Q.pickdate}if(Q.picktime!==undefined){l.options.pickTime=Q.picktime}if(Q.useminutes!==undefined){l.options.useMinutes=Q.useminutes}if(Q.useseconds!==undefined){l.options.useSeconds=Q.useseconds}if(Q.minutestepping!==undefined){l.options.minuteStepping=Q.minutestepping}if(Q.startdate!==undefined){l.options.startDate=Q.startdate}if(Q.enddate!==undefined){l.options.endDate=Q.enddate}if(Q.collapse!==undefined){l.options.collapse=Q.collapse}if(Q.language!==undefined){l.options.language=Q.language}if(Q.defaultdate!==undefined){l.options.defaultDate=Q.defaultdate}if(Q.disableddates!==undefined){l.options.disabledDates=Q.disableddates}if(Q.enableddates!==undefined){l.options.enabledDates=Q.enableddates}if(Q.icons!==undefined){l.options.icons=Q.icons}if(Q.usestrict!==undefined){l.options.useStrict=Q.usestrict}},j=function(){var Q="absolute",S=l.component?l.component.offset():l.element.offset(),R=d(window);l.width=l.component?l.component.outerWidth():l.element.outerWidth();S.top=S.top+l.element.outerHeight();if(l.options.width!==undefined){l.widget.width(l.options.width)}if(l.options.orientation==="left"){l.widget.addClass("left-oriented");S.left=S.left-l.widget.width()+20}if(B()){Q="fixed";S.top-=R.scrollTop();S.left-=R.scrollLeft()}if(R.width()<S.left+l.widget.outerWidth()){S.right=R.width()-S.left-l.width;S.left="auto";l.widget.addClass("pull-right")}else{S.right="auto";l.widget.removeClass("pull-right")}l.widget.css({position:Q,top:S.top,left:S.left,right:S.right})},p=function(R,Q){l.element.trigger({type:"change.dp",date:a(l.date),oldDate:a(R)});if(Q!=="change"){l.element.change()}},C=function(Q){l.element.trigger({type:"error.dp",date:a(Q)})},y=function(Q){a.lang(l.options.language);var R=Q;if(!R){if(l.isInput){R=l.element.val()}else{R=l.element.find("input").val()}if(R){l.date=a(R,l.format,l.options.useStrict)}if(!l.date){l.date=a()}}l.viewDate=a(l.date).startOf("month");n();k()},H=function(){a.lang(l.options.language);var S=d("<tr>"),Q=a.weekdaysMin(),R;if(a()._lang._week.dow==0){for(R=0;R<7;R++){S.append('<th class="dow">'+Q[R]+"</th>")}}else{for(R=1;R<8;R++){if(R==7){S.append('<th class="dow">'+Q[0]+"</th>")}else{S.append('<th class="dow">'+Q[R]+"</th>")}}}l.widget.find(".datepicker-days thead").append(S)},u=function(){a.lang(l.options.language);var R="",Q=0,S=a.monthsShort();while(Q<12){R+='<span class="month">'+S[Q++]+"</span>"}l.widget.find(".datepicker-months td").append(R)},n=function(){a.lang(l.options.language);var ab=l.viewDate.year(),Z=l.viewDate.month(),aa=l.options.startDate.year(),ad=l.options.startDate.month(),ae=l.options.endDate.year(),X=l.options.endDate.month(),T,W,V=[],af,S,U,ac,R,Y,Q=a.months();l.widget.find(".datepicker-days").find(".disabled").removeClass("disabled");l.widget.find(".datepicker-months").find(".disabled").removeClass("disabled");l.widget.find(".datepicker-years").find(".disabled").removeClass("disabled");l.widget.find(".datepicker-days th:eq(1)").text(Q[Z]+" "+ab);T=a(l.viewDate).subtract("months",1);ac=T.daysInMonth();T.date(ac).startOf("week");if((ab==aa&&Z<=ad)||ab<aa){l.widget.find(".datepicker-days th:eq(0)").addClass("disabled")}if((ab==ae&&Z>=X)||ab>ae){l.widget.find(".datepicker-days th:eq(2)").addClass("disabled")}W=a(T).add(42,"d");while(T.isBefore(W)){if(T.weekday()===a().startOf("week").weekday()){af=d("<tr>");V.push(af)}S="";if(T.year()<ab||(T.year()==ab&&T.month()<Z)){S+=" old"}else{if(T.year()>ab||(T.year()==ab&&T.month()>Z)){S+=" new"}}if(T.isSame(a({y:l.date.year(),M:l.date.month(),d:l.date.date()}))){S+=" active"}if((a(T).add(1,"d")<=l.options.startDate)||(T>l.options.endDate)||O(T)||!s(T)){S+=" disabled"}af.append('<td class="day'+S+'">'+T.date()+"</td>");T.add(1,"d")}l.widget.find(".datepicker-days tbody").empty().append(V);Y=a().year(),Q=l.widget.find(".datepicker-months").find("th:eq(1)").text(ab).end().find("span").removeClass("active");if(Y===ab){Q.eq(a().month()).addClass("active")}if(Y-1<aa){l.widget.find(".datepicker-months th:eq(0)").addClass("disabled")}if(Y+1>ae){l.widget.find(".datepicker-months th:eq(2)").addClass("disabled")}for(U=0;U<12;U++){if((ab==aa&&ad>U)||(ab<aa)){d(Q[U]).addClass("disabled")}else{if((ab==ae&&X<U)||(ab>ae)){d(Q[U]).addClass("disabled")}}}V="";ab=parseInt(ab/10,10)*10;R=l.widget.find(".datepicker-years").find("th:eq(1)").text(ab+"-"+(ab+9)).end().find("td");l.widget.find(".datepicker-years").find("th").removeClass("disabled");if(aa>ab){l.widget.find(".datepicker-years").find("th:eq(0)").addClass("disabled")}if(ae<ab+9){l.widget.find(".datepicker-years").find("th:eq(2)").addClass("disabled")}ab-=1;for(U=-1;U<11;U++){V+='<span class="year'+(U===-1||U===10?" old":"")+(Y===ab?" active":"")+((ab<aa||ab>ae)?" disabled":"")+'">'+ab+"</span>";ab+=1}R.html(V)},v=function(){a.lang(l.options.language);var T=l.widget.find(".timepicker .timepicker-hours table"),S="",U,R,Q;T.parent().hide();if(l.options.use24hours){U=0;for(R=0;R<6;R+=1){S+="<tr>";for(Q=0;Q<4;Q+=1){S+='<td class="hour">'+N(U.toString())+"</td>";U++}S+="</tr>"}}else{U=1;for(R=0;R<3;R+=1){S+="<tr>";for(Q=0;Q<4;Q+=1){S+='<td class="hour">'+N(U.toString())+"</td>";U++}S+="</tr>"}}T.html(S)},t=function(){var T=l.widget.find(".timepicker .timepicker-minutes table"),S="",U=0,R,Q;T.parent().hide();for(R=0;R<5;R++){S+="<tr>";for(Q=0;Q<4;Q+=1){S+='<td class="minute">'+N(U.toString())+"</td>";U+=3}S+="</tr>"}T.html(S)},h=function(){var T=l.widget.find(".timepicker .timepicker-seconds table"),S="",U=0,R,Q;T.parent().hide();for(R=0;R<5;R++){S+="<tr>";for(Q=0;Q<4;Q+=1){S+='<td class="second">'+N(U.toString())+"</td>";U+=3}S+="</tr>"}T.html(S)},k=function(){if(!l.date){return}var S=l.widget.find(".timepicker span[data-time-component]"),Q=l.date.hours(),R="AM";if(!l.options.use24hours){if(Q>=12){R="PM"}if(Q===0){Q=12}else{if(Q!=12){Q=Q%12}}l.widget.find(".timepicker [data-action=togglePeriod]").text(R)}S.filter("[data-time-component=hours]").text(N(Q));S.filter("[data-time-component=minutes]").text(N(l.date.minutes()));S.filter("[data-time-component=seconds]").text(N(l.date.second()))},A=function(W){W.stopPropagation();W.preventDefault();l.unset=false;var V=d(W.target).closest("span, td, th"),U,S,T,Q,R=a(l.date);if(V.length===1){if(!V.is(".disabled")){switch(V[0].nodeName.toLowerCase()){case"th":switch(V[0].className){case"switch":g(1);break;case"prev":case"next":T=w.modes[l.viewMode].navStep;if(V[0].className==="prev"){T=T*-1}l.viewDate.add(T,w.modes[l.viewMode].navFnc);n();break}break;case"span":if(V.is(".month")){U=V.parent().find("span").index(V);l.viewDate.month(U)}else{S=parseInt(V.text(),10)||0;l.viewDate.year(S)}if(l.viewMode!==0){l.date=a({y:l.viewDate.year(),M:l.viewDate.month(),d:l.viewDate.date(),h:l.date.hours(),m:l.date.minutes()});p(R,W.type)}g(-1);n();break;case"td":if(V.is(".day")){Q=parseInt(V.text(),10)||1;U=l.viewDate.month();S=l.viewDate.year();if(V.is(".old")){if(U===0){U=11;S-=1}else{U-=1}}else{if(V.is(".new")){if(U==11){U=0;S+=1}else{U+=1}}}l.date=a({y:S,M:U,d:Q,h:l.date.hours(),m:l.date.minutes()});l.viewDate=a({y:S,M:U,d:Math.min(28,Q)});n();r();p(R,W.type)}break}}}},D={incrementHours:function(){m("add","hours",1)},incrementMinutes:function(){m("add","minutes",l.options.minuteStepping)},incrementSeconds:function(){m("add","seconds",1)},decrementHours:function(){m("subtract","hours",1)},decrementMinutes:function(){m("subtract","minutes",l.options.minuteStepping)},decrementSeconds:function(){m("subtract","seconds",1)},togglePeriod:function(){var Q=l.date.hours();if(Q>=12){Q-=12}else{Q+=12}l.date.hours(Q)},showPicker:function(){l.widget.find(".timepicker > div:not(.timepicker-picker)").hide();l.widget.find(".timepicker .timepicker-picker").show()},showHours:function(){l.widget.find(".timepicker .timepicker-picker").hide();l.widget.find(".timepicker .timepicker-hours").show()},showMinutes:function(){l.widget.find(".timepicker .timepicker-picker").hide();l.widget.find(".timepicker .timepicker-minutes").show()},showSeconds:function(){l.widget.find(".timepicker .timepicker-picker").hide();l.widget.find(".timepicker .timepicker-seconds").show()},selectHour:function(Q){l.date.hours(parseInt(d(Q.target).text(),10));D.showPicker.call(l)},selectMinute:function(Q){l.date.minutes(parseInt(d(Q.target).text(),10));D.showPicker.call(l)},selectSecond:function(Q){l.date.seconds(parseInt(d(Q.target).text(),10));D.showPicker.call(l)}},x=function(S){var Q=a(l.date),R=d(S.currentTarget).data("action"),T=D[R].apply(l,arguments);K(S);if(!l.date){l.date=a({y:1970})}r();k();p(Q);return T},K=function(Q){Q.stopPropagation();Q.preventDefault()},i=function(S){a.lang(l.options.language);var Q=d(S.target),R=a(l.date),T=a(Q.val(),l.format,l.options.useStrict);if(T.isValid()){y();l.setValue(T);p(R);r()}else{l.viewDate=R;p(R);C(T);l.unset=true;Q.val("")}},g=function(Q){if(Q){l.viewMode=Math.max(l.minViewMode,Math.min(2,l.viewMode+Q))}l.widget.find(".datepicker > div").hide().filter(".datepicker-"+w.modes[l.viewMode].clsName).show()},J=function(){var U,T,R,Q,S;l.widget.on("click",".datepicker *",d.proxy(A,this));l.widget.on("click","[data-action]",d.proxy(x,this));l.widget.on("mousedown",d.proxy(K,this));if(l.options.pickDate&&l.options.pickTime){l.widget.on("click.togglePicker",".accordion-toggle",function(V){V.stopPropagation();U=d(this);T=U.closest("ul");R=T.find(".in");Q=T.find(".collapse:not(.in)");if(R&&R.length){S=R.data("collapse");if(S&&S.transitioning){return}R.collapse("hide");Q.collapse("show");U.find("span").toggleClass(l.options.icons.time+" "+l.options.icons.date);l.element.find(".input-group-addon span").toggleClass(l.options.icons.time+" "+l.options.icons.date)}})}if(l.isInput){l.element.on({focus:d.proxy(l.show,this),change:d.proxy(i,this),blur:d.proxy(l.hide,this)})}else{l.element.on({change:d.proxy(i,this)},"input");if(l.component){l.component.on("click",d.proxy(l.show,this))}else{l.element.on("click",d.proxy(l.show,this))}}},L=function(){d(window).on("resize.datetimepicker"+l.id,d.proxy(j,this));if(!l.isInput){d(document).on("mousedown.datetimepicker"+l.id,d.proxy(l.hide,this))}},F=function(){l.widget.off("click",".datepicker *",l.click);l.widget.off("click","[data-action]");l.widget.off("mousedown",l.stopEvent);if(l.options.pickDate&&l.options.pickTime){l.widget.off("click.togglePicker")}if(l.isInput){l.element.off({focus:l.show,change:l.change})}else{l.element.off({change:l.change},"input");if(l.component){l.component.off("click",l.show)}else{l.element.off("click",l.show)}}},E=function(){d(window).off("resize.datetimepicker"+l.id);if(!l.isInput){d(document).off("mousedown.datetimepicker"+l.id)}},B=function(){if(l.element){var R=l.element.parents(),Q=false,S;for(S=0;S<R.length;S++){if(d(R[S]).css("position")=="fixed"){Q=true;break}}return Q}else{return false}},r=function(){a.lang(l.options.language);var R="",Q;if(!l.unset){R=a(l.date).format(l.format)}if(!l.isInput){if(l.component){Q=l.element.find("input");Q.val(R)}l.element.data("date",R)}else{l.element.val(R)}if(!l.options.pickTime){l.hide()}},m=function(T,S,R){a.lang(l.options.language);var Q;if(T=="add"){Q=a(l.date);if(Q.hours()==23){Q.add(R,S)}Q.add(R,S)}else{Q=a(l.date).subtract(R,S)}if(Q.isAfter(l.options.endDate)||a(Q.subtract(R,S)).isBefore(l.options.startDate)||O(Q)){C(Q.format(l.format));return}if(T=="add"){l.date.add(R,S)}else{l.date.subtract(R,S)}},O=function(Q){a.lang(l.options.language);var S=l.options.disabledDates,R;for(R in S){if(S[R]==a(Q).format("L")){return true}}return false},s=function(R){a.lang(l.options.language);var Q=l.options.enabledDates,S;if(Q.length){for(S in Q){if(Q[S]==a(R).format("L")){return true}}return false}return Q===false?true:false},N=function(Q){Q=Q.toString();if(Q.length>=2){return Q}else{return"0"+Q}},P=function(R,Q,S){if(R&&Q){return('<div class="bootstrap-datetimepicker-widget dropdown-menu" style="z-index:9999 !important;"><ul class="list-unstyled"><li'+(S?' class="collapse in"':"")+'><div class="datepicker">'+w.template+'</div></li><li class="picker-switch accordion-toggle"><a class="btn" style="width:100%"><span class="'+l.options.icons.time+'"></span></a></li><li'+(S?' class="collapse"':"")+'><div class="timepicker">'+G.getTemplate()+"</div></li></ul></div>")}else{if(Q){return('<div class="bootstrap-datetimepicker-widget dropdown-menu"><div class="timepicker">'+G.getTemplate()+"</div></div>")}else{return('<div class="bootstrap-datetimepicker-widget dropdown-menu"><div class="datepicker">'+w.template+"</div></div>")}}},w={modes:[{clsName:"days",navFnc:"month",navStep:1},{clsName:"months",navFnc:"year",navStep:1},{clsName:"years",navFnc:"year",navStep:10}],headTemplate:'<thead><tr><th class="prev">‹</th><th colspan="5" class="switch"></th><th class="next">›</th></tr></thead>',contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>'},G={hourTemplate:'<span data-action="showHours" data-time-component="hours" class="timepicker-hour"></span>',minuteTemplate:'<span data-action="showMinutes" data-time-component="minutes" class="timepicker-minute"></span>',secondTemplate:'<span data-action="showSeconds" data-time-component="seconds" class="timepicker-second"></span>'};w.template='<div class="datepicker-days"><table class="table-condensed">'+w.headTemplate+'<tbody></tbody></table></div><div class="datepicker-months"><table class="table-condensed">'+w.headTemplate+w.contTemplate+'</table></div><div class="datepicker-years"><table class="table-condensed">'+w.headTemplate+w.contTemplate+"</table></div>";G.getTemplate=function(){return('<div class="timepicker-picker"><table class="table-condensed"><tr><td><a href="#" class="btn" data-action="incrementHours"><span class="'+l.options.icons.up+'"></span></a></td><td class="separator"></td><td>'+(l.options.useMinutes?'<a href="#" class="btn" data-action="incrementMinutes"><span class="'+l.options.icons.up+'"></span></a>':"")+"</td>"+(l.options.useSeconds?'<td class="separator"></td><td><a href="#" class="btn" data-action="incrementSeconds"><span class="'+l.options.icons.up+'"></span></a></td>':"")+(l.options.use24hours?"":'<td class="separator"></td>')+"</tr><tr><td>"+G.hourTemplate+'</td> <td class="separator">:</td><td>'+(l.options.useMinutes?G.minuteTemplate:'<span class="timepicker-minute">00</span>')+"</td> "+(l.options.useSeconds?'<td class="separator">:</td><td>'+G.secondTemplate+"</td>":"")+(l.options.use24hours?"":'<td class="separator"></td><td><button type="button" class="btn btn-primary" data-action="togglePeriod"></button></td>')+'</tr><tr><td><a href="#" class="btn" data-action="decrementHours"><span class="'+l.options.icons.down+'"></span></a></td><td class="separator"></td><td>'+(l.options.useMinutes?'<a href="#" class="btn" data-action="decrementMinutes"><span class="'+l.options.icons.down+'"></span></a>':"")+"</td>"+(l.options.useSeconds?'<td class="separator"></td><td><a href="#" class="btn" data-action="decrementSeconds"><span class="'+l.options.icons.down+'"></span></a></td>':"")+(l.options.use24hours?"":'<td class="separator"></td>')+'</tr></table></div><div class="timepicker-hours" data-action="selectHour"><table class="table-condensed"></table></div><div class="timepicker-minutes" data-action="selectMinute"><table class="table-condensed"></table></div>'+(l.options.useSeconds?'<div class="timepicker-seconds" data-action="selectSecond"><table class="table-condensed"></table></div>':""))};l.destroy=function(){F();E();l.widget.remove();l.element.removeData("DateTimePicker");if(l.component){l.component.removeData("DateTimePicker")}};l.show=function(Q){l.widget.show();l.height=l.component?l.component.outerHeight():l.element.outerHeight();j();l.element.trigger({type:"show.dp",date:a(l.date)});L();if(Q){K(Q)}},l.disable=function(){var Q=l.element.find("input");if(!Q.prop("disabled")){return}Q.prop("disabled",true);F()},l.enable=function(){var Q=l.element.find("input");if(!Q.prop("disabled")){return}Q.prop("disabled",true);J()},l.hide=function(S){if(S&&d(S.target).is(l.element.attr("id"))){return}var T=l.widget.find(".collapse"),Q,R;for(Q=0;Q<T.length;Q++){R=T.eq(Q).data("collapse");if(R&&R.transitioning){return}}l.widget.hide();l.viewMode=l.startViewMode;g();l.element.trigger({type:"hide.dp",date:a(l.date)});E()},l.setValue=function(Q){a.lang(l.options.language);if(!Q){l.unset=true}else{l.unset=false}if(!a.isMoment(Q)){Q=a(Q)}if(Q.isValid()){l.date=Q;r();l.viewDate=a({y:l.date.year(),M:l.date.month()});n();k()}else{C(Q)}},l.getDate=function(){if(l.unset){return null}return l.date},l.setDate=function(Q){Q=a(Q);if(!Q){l.setValue(null)}else{l.setValue(Q)}},l.setEnabledDates=function(Q){if(!Q){l.options.enabledDates=false}else{l.options.enabledDates=Q}if(l.viewDate){y()}},l.setEndDate=function(Q){l.options.endDate=a(Q);if(!l.options.endDate.isValid()){l.options.endDate=a().add(50,"y")}if(l.viewDate){y()}},l.setStartDate=function(Q){l.options.startDate=a(Q);if(!l.options.startDate.isValid()){l.options.startDate=a({y:1970})}if(l.viewDate){y()}};I()};d.fn.datetimepicker=function(f){return this.each(function(){var h=d(this),g=h.data("DateTimePicker");if(!g){h.data("DateTimePicker",new b(this,f))}})}}));
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bootstrap3-datetimepicker-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.20
|
4
|
+
version: 2.1.20.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-01-
|
12
|
+
date: 2014-01-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -67,72 +67,72 @@ executables: []
|
|
67
67
|
extensions: []
|
68
68
|
extra_rdoc_files: []
|
69
69
|
files:
|
70
|
-
- lib/bootstrap3-datetimepicker-rails.rb
|
71
70
|
- lib/bootstrap3-datetimepicker-rails/version.rb
|
72
|
-
-
|
73
|
-
- vendor/assets/
|
74
|
-
- vendor/assets/javascripts/
|
75
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.
|
76
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.sk.js
|
77
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.mr.js
|
78
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.et.js
|
79
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.eo.js
|
80
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.id.js
|
81
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.ms-my.js
|
82
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.lv.js
|
71
|
+
- lib/bootstrap3-datetimepicker-rails.rb
|
72
|
+
- vendor/assets/javascripts/bootstrap-datetimepicker.js
|
73
|
+
- vendor/assets/javascripts/bootstrap-datetimepicker.min.js
|
74
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.ar-ma.js
|
83
75
|
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.ar.js
|
84
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.
|
85
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.
|
86
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.
|
87
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.
|
88
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.
|
76
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.bg.js
|
77
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.br.js
|
78
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.bs.js
|
79
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.ca.js
|
80
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.cs.js
|
81
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.cv.js
|
82
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.da.js
|
83
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.de.js
|
84
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.el.js
|
85
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.en-au.js
|
89
86
|
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.en-ca.js
|
90
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.
|
91
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.
|
92
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.pl.js
|
87
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.en-gb.js
|
88
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.eo.js
|
93
89
|
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.es.js
|
94
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.
|
95
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.
|
96
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.
|
97
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.
|
98
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.
|
90
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.et.js
|
91
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.eu.js
|
92
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.fa.js
|
93
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.fi.js
|
94
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.fr-ca.js
|
99
95
|
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.fr.js
|
96
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.gl.js
|
97
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.he.js
|
98
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.hi.js
|
100
99
|
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.hr.js
|
100
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.hu.js
|
101
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.id.js
|
102
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.is.js
|
103
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.it.js
|
104
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.ja.js
|
105
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.ka.js
|
106
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.ko.js
|
107
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.lt.js
|
108
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.lv.js
|
109
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.ml.js
|
110
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.mr.js
|
111
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.ms-my.js
|
112
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.nb.js
|
101
113
|
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.ne.js
|
114
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.nl.js
|
115
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.nn.js
|
116
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.pl.js
|
117
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.pt-BR.js
|
118
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.pt.js
|
119
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.ro.js
|
102
120
|
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.ru.js
|
103
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.
|
104
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.uk.js
|
105
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.tr.js
|
106
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.ka.js
|
107
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.sq.js
|
108
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.en-au.js
|
121
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.sk.js
|
109
122
|
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.sl.js
|
110
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.
|
123
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.sq.js
|
124
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.sv.js
|
111
125
|
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.th.js
|
126
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.tr.js
|
127
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.tzm-la.js
|
128
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.tzm.js
|
129
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.uk.js
|
112
130
|
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.uz.js
|
113
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.
|
114
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.el.js
|
115
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.br.js
|
116
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.fr-ca.js
|
117
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.bg.js
|
118
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.eu.js
|
131
|
+
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.vn.js
|
119
132
|
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.zh-CN.js
|
120
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.ja.js
|
121
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.fa.js
|
122
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.he.js
|
123
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.nl.js
|
124
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.da.js
|
125
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.ko.js
|
126
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.cs.js
|
127
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.gl.js
|
128
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.nb.js
|
129
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.ca.js
|
130
133
|
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.zh-TW.js
|
131
|
-
- vendor/assets/
|
132
|
-
- vendor/assets/
|
133
|
-
- vendor/assets/javascripts/locales/bootstrap-datetimepicker.lt.js
|
134
|
-
- vendor/assets/javascripts/bootstrap-datetimepicker.min.js
|
135
|
-
- vendor/assets/javascripts/bootstrap-datetimepicker.js
|
134
|
+
- vendor/assets/stylesheets/bootstrap-datetimepicker.css
|
135
|
+
- vendor/assets/stylesheets/bootstrap-datetimepicker.min.css
|
136
136
|
- LICENSE.txt
|
137
137
|
- README.md
|
138
138
|
homepage: http://github.com/TrevorS/bootstrap3-datetimepicker-rails
|