You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
9 lines
22 KiB
9 lines
22 KiB
4 years ago
|
/**
|
||
|
* @version: 1.3.5
|
||
|
* @author: Dan Grossman http://www.dangrossman.info/
|
||
|
* @date: 2014-03-19
|
||
|
* @copyright: Copyright (c) 2012-2014 Dan Grossman. All rights reserved.
|
||
|
* @license: Licensed under Apache License v2.0. See http://www.apache.org/licenses/LICENSE-2.0
|
||
|
* @website: http://www.improvely.com/
|
||
|
*/
|
||
|
!function(b,c){var a=function(g,f,d){this.parentEl="body";this.element=b(g);var e='<div class="daterangepicker dropdown-menu"><div class="calendar left"></div><div class="calendar right"></div><div class="ranges"><div class="range_inputs"><div class="daterangepicker_start_input"><label for="daterangepicker_start"></label><input class="input-mini" type="text" name="daterangepicker_start" value="" disabled="disabled" /></div><div class="daterangepicker_end_input"><label for="daterangepicker_end"></label><input class="input-mini" type="text" name="daterangepicker_end" value="" disabled="disabled" /></div><button class="applyBtn" disabled="disabled"></button> <button class="cancelBtn"></button></div></div></div>';if(typeof f!=="object"||f===null){f={}}this.parentEl=(typeof f==="object"&&f.parentEl&&b(f.parentEl).length)||b(this.parentEl);this.container=b(e).appendTo(this.parentEl);this.setOptions(f,d);var h=this.container;b.each(this.buttonClasses,function(i,j){h.find("button").addClass(j)});this.container.find(".daterangepicker_start_input label").html(this.locale.fromLabel);this.container.find(".daterangepicker_end_input label").html(this.locale.toLabel);if(this.applyClass.length){this.container.find(".applyBtn").addClass(this.applyClass)}if(this.cancelClass.length){this.container.find(".cancelBtn").addClass(this.cancelClass)}this.container.find(".applyBtn").html(this.locale.applyLabel);this.container.find(".cancelBtn").html(this.locale.cancelLabel);this.container.find(".calendar").on("click.daterangepicker",".prev",b.proxy(this.clickPrev,this)).on("click.daterangepicker",".next",b.proxy(this.clickNext,this)).on("click.daterangepicker","td.available",b.proxy(this.clickDate,this)).on("mouseenter.daterangepicker","td.available",b.proxy(this.enterDate,this)).on("mouseleave.daterangepicker","td.available",b.proxy(this.updateFormInputs,this)).on("change.daterangepicker","select.yearselect",b.proxy(this.updateMonthYear,this)).on("change.daterangepicker","select.monthselect",b.proxy(this.updateMonthYear,this)).on("change.daterangepicker","select.hourselect,select.minuteselect,select.ampmselect",b.proxy(this.updateTime,this));this.container.find(".ranges").on("click.daterangepicker","button.applyBtn",b.proxy(this.clickApply,this)).on("click.daterangepicker","button.cancelBtn",b.proxy(this.clickCancel,this)).on("click.daterangepicker",".daterangepicker_start_input,.daterangepicker_end_input",b.proxy(this.showCalendars,this)).on("click.daterangepicker","li",b.proxy(this.clickRange,this)).on("mouseenter.daterangepicker","li",b.proxy(this.enterRange,this)).on("mouseleave.daterangepicker","li",b.proxy(this.updateFormInputs,this));if(this.element.is("input")){this.element.on({"click.daterangepicker":b.proxy(this.show,this),"focus.daterangepicker":b.proxy(this.show,this),"keyup.daterangepicker":b.proxy(this.updateFromControl,this)})}else{this.element.on("click.daterangepicker",b.proxy(this.toggle,this))}};a.prototype={constructor:a,setOptions:function(n,m){this.startDate=c().startOf("day");this.endDate=c().endOf("day");this.minDate=false;this.maxDate=false;this.dateLimit=false;this.showDropdowns=false;this.showWeekNumbers=false;this.timePicker=false;this.timePickerIncrement=30;this.timePicker12Hour=true;this.singleDatePicker=false;this.ranges={};this.opens="right";if(this.element.hasClass("pull-right")){this.opens="left"}this.buttonClasses=["btn","btn-small"];this.applyClass="btn-success";this.cancelClass="btn-default";this.format="MM/DD/YYYY";this.separator=" - ";this.locale={applyLabel:"Apply",cancelLabel:"Cancel",fromLabel:"From",toLabel:"To",weekLabel:"W",customRangeLabel:"Custom Range",daysOfWeek:c()._lang._weekdaysMin.slice(),monthNames:c()._lang._monthsShort.slice(),firstDay:0};this.cb=function(){};if(typeof n.format==="string"){this.format=n.format}if(typeof n.separator==="string"){this.separator=n.separator}if(typeof n.startDate==="string"){this.startDate=c(n.startDate,this.format)}if(typeof n.endDate==="string"){this.endDate=c(n.endDate,this.format)}if(typeof n.minDate==="string"){this.minDate=c(n.minDate,this.format)}if(
|