1 line
47 KiB
JavaScript
1 line
47 KiB
JavaScript
(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["datepicker-TRangePicker"],{9300:(__unused_webpack_module,__unused_webpack_exports,__webpack_require__)=>{eval("/* provided dependency */ var jQuery = __webpack_require__(9755);\n( function( $ ) {\n\n\t$.fn.TRangePicker = function( options ) {\n\t\tvar opts = $.extend( {}, $.fn.TRangePicker.defaults, options );\n\t\t//Global.addCss( 'global/widgets/datepicker/TDatePicker.css' );\n\n\t\tvar $this = this;\n\t\tvar field;\n\t\tvar validation_field;\n\t\tvar date_picker_input;\n\t\tvar icon;\n\t\tvar error_string = '';\n\t\tvar error_tip_box;\n\t\tvar mass_edit_mode = false;\n\t\tvar check_box = null;\n\t\tvar enabled = true;\n\t\tvar is_open = false;\n\t\tvar focus_out_timer;\n\t\tvar is_mouse_over = false;\n\t\tvar ranger_picker;\n\n\t\tvar range_start_picker;\n\t\tvar range_end_picker;\n\n\t\tvar result;\n\n\t\tvar editor;\n\n\t\tvar can_not_close = false;\n\n\t\tvar tab_bars;\n\n\t\tvar date_picker;\n\n\t\tvar default_width_by_format = {\n\t\t\t'DD-MMM-YY': 100,\n\t\t\t'ddd, MMMM DD YYYY': 170,\n\t\t\t'dddd, MMMM DD YYYY': 190,\n\t\t\t'DD-MMM-YYYY': 110,\n\t\t\t'DDMMMYYYY': 100,\n\t\t\t'DD/MM/YYYY': 100,\n\t\t\t'DD/MM/YY': 100,\n\t\t\t'DD-MM-YY': 100,\n\t\t\t'DD-MM-YYYY': 100,\n\t\t\t'MM/DD/YY': 100,\n\t\t\t'MM/DD/YYYY': 100,\n\t\t\t'MM-DD-YY': 100,\n\t\t\t'MM-DD-YYYY': 100,\n\t\t\t'YYYY-MM-DD': 100,\n\t\t\t'MMM-DD-YY': 100,\n\t\t\t'MMM-DD-YYYY': 110,\n\t\t\t'ddd, MMM DD YYYY': 140,\n\t\t\t'ddd, DD-MMM-YYYY': 140,\n\t\t\t'ddd, DDMMMYYYY': 130\n\t\t};\n\n\t\tthis.getEnabled = function() {\n\t\t\treturn enabled;\n\t\t};\n\n\t\tthis.setEnabled = function( val ) {\n\t\t\tenabled = val;\n\t\t\tif ( val === false || val === '' ) {\n\t\t\t\t$this.attr( 'disabled', 'true' );\n\t\t\t\tdate_picker_input.addClass( 't-date-picker-readonly' );\n\t\t\t\ticon.css( 'display', 'none' );\n//\t\t\t\tdate_picker_input.attr( 'readonly', 'readonly' )\n\t\t\t} else {\n\t\t\t\t$this.removeAttr( 'disabled' );\n\t\t\t\tdate_picker_input.removeClass( 't-date-picker-readonly' );\n\t\t\t\ticon.css( 'display', 'inline' );\n//\t\t\t\tdate_picker_input.removeAttr( 'readonly' );\n\t\t\t}\n\n\t\t};\n\n\t\tthis.setCheckBox = function( val ) {\n\t\t\tif ( check_box ) {\n\t\t\t\tcheck_box.children().eq( 0 )[0].checked = val;\n\t\t\t}\n\t\t};\n\n\t\tthis.isChecked = function() {\n\t\t\tif ( check_box ) {\n\t\t\t\tif ( check_box.children().eq( 0 )[0].checked === true ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t};\n\n\t\tthis.setMassEditMode = function( val ) {\n\t\t\tmass_edit_mode = val;\n\n\t\t\tif ( mass_edit_mode ) {\n\t\t\t\tcheck_box = $( ' <div class=\"mass-edit-checkbox-wrapper\"><input type=\"checkbox\" class=\"mass-edit-checkbox\"></input>' +\n\t\t\t\t\t'<label for=\"checkbox-input-1\" class=\"input-helper input-helper--checkbox\"></label></div>' );\n\t\t\t\tcheck_box.insertBefore( $( this ) );\n\n\t\t\t\tcheck_box.change( function() {\n\t\t\t\t\t$this.trigger( 'formItemChange', [$this] );\n\t\t\t\t} );\n\n\t\t\t} else {\n\t\t\t\tif ( check_box ) {\n\t\t\t\t\tcheck_box.remove();\n\t\t\t\t\tcheck_box = null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t};\n\n\t\tthis.setErrorStyle = function( errStr, show, isWarning ) {\n\t\t\tif ( isWarning ) {\n\t\t\t\tdate_picker_input.addClass( 'warning-tip' );\n\t\t\t} else {\n\t\t\t\tdate_picker_input.addClass( 'error-tip' );\n\t\t\t}\n\t\t\terror_string = errStr;\n\n\t\t\tif ( show ) {\n\t\t\t\tthis.showErrorTip();\n\t\t\t}\n\t\t};\n\n\t\tthis.showErrorTip = function( sec ) {\n\n\t\t\tif ( !Global.isSet( sec ) ) {\n\t\t\t\tsec = 2;\n\t\t\t}\n\n\t\t\tif ( !error_tip_box ) {\n\t\t\t\terror_tip_box = Global.loadWidgetByName( WidgetNamesDic.ERROR_TOOLTIP );\n\t\t\t\terror_tip_box = error_tip_box.ErrorTipBox();\n\t\t\t}\n\t\t\tif ( date_picker_input.hasClass( 'warning-tip' ) ) {\n\t\t\t\terror_tip_box.show( this, error_string, sec, true );\n\t\t\t} else {\n\t\t\t\terror_tip_box.show( this, error_string, sec );\n\t\t\t}\n\t\t};\n\n\t\tthis.hideErrorTip = function() {\n\n\t\t\tif ( Global.isSet( error_tip_box ) ) {\n\t\t\t\terror_tip_box.remove();\n\t\t\t}\n\n\t\t};\n\n\t\tthis.clearErrorStyle = function() {\n\t\t\tdate_picker_input.removeClass( 'error-tip' );\n\t\t\tdate_picker_input.removeClass( 'warning-tip' );\n\t\t\tthis.hideErrorTip();\n\t\t\terror_string = '';\n\t\t};\n\n\t\tthis.getField = function() {\n\t\t\treturn field;\n\t\t};\n\n\t\tthis.getValidationField = function() {\n\t\t\treturn validation_field;\n\t\t};\n\n\t\tthis.getDefaultFormatValue = function() {\n\t\t\tvar val = date_picker_input.val();\n\n\t\t\tval = Global.strToDate( val ).format( 'YYYY-MM-DD' );\n\n\t\t\treturn val;\n\t\t};\n\n\t\tthis.getValue = function() {\n\t\t\treturn result;\n\t\t};\n\n\t\tthis.setValue = function( val ) {\n\t\t\tif ( !val ) {\n\t\t\t\tval = '';\n\t\t\t}\n\t\t\tif ( $.type( val ) !== 'array' ) {\n\t\t\t\tresult = [val];\n\t\t\t\tdate_picker_input.val( val );\n\t\t\t\tdate_picker_input.removeAttr( 'readonly' );\n\t\t\t} else {\n\t\t\t\tresult = val;\n\t\t\t\tif ( val.length == 1 ) {\n\t\t\t\t\tdate_picker_input.val( val[0] );\n\t\t\t\t\tdate_picker_input.removeAttr( 'readonly' );\n\t\t\t\t} else {\n\t\t\t\t\tdate_picker_input.val( val.length + ' ' + $.i18n._( 'dates selected' ) );\n\t\t\t\t\tdate_picker_input.attr( 'readonly', 'readonly' );\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.autoResize();\n\t\t};\n\n\t\tthis.autoResize = function() {\n\t\t\tvar content_width, example_width;\n\t\t\texample_width = Global.calculateTextWidth( LocalCacheData.getLoginUserPreference().date_format_display );\n\t\t\tcontent_width = Global.calculateTextWidth( date_picker_input.val(), {\n\t\t\t\tmin_width: example_width,\n\t\t\t\tmax_width: ( ( example_width * 2 ) + 100 ),\n\t\t\t\tpadding: 28\n\t\t\t} );\n\t\t\tdate_picker.width( content_width + 'px' );\n\t\t};\n\n\t\tthis.close = function() {\n\n\t\t\tif ( can_not_close ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar tab_index = tab_bars.tabs( 'option', 'active' );\n\n\t\t\tranger_picker.remove();\n\t\t\tis_open = false;\n\t\t\tLocalCacheData.openRangerPicker = null;\n\t\t\tis_mouse_over = false; //When close from esc, this maybe true\n\n\t\t\tif ( tab_index == 0 ) {\n\t\t\t\tresult = range_start_picker.val() + ' - ' + range_end_picker.val();\n\t\t\t\tdate_picker_input.val( result );\n\t\t\t\tdate_picker_input.attr( 'readonly', 'readonly' );\n\t\t\t} else {\n\t\t\t\tresult = editor.getValue();\n\n\t\t\t\tif ( result.length > 1 ) {\n\t\t\t\t\tdate_picker_input.val( result.length + ' ' + $.i18n._( 'dates selected' ) );\n\t\t\t\t\tdate_picker_input.attr( 'readonly', 'readonly' );\n\t\t\t\t} else {\n\t\t\t\t\tdate_picker_input.val( result[0] );\n\t\t\t\t\tdate_picker_input.removeAttr( 'readonly' );\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis.autoResize();\n\n\t\t\tsetTimeout( function() {\n\t\t\t\t$this.trigger( 'formItemChange', [$this] );\n\t\t\t}, 100 );\n//\n\n\t\t};\n\n\t\tthis.getIsMouseOver = function() {\n\t\t\treturn is_mouse_over;\n\t\t};\n\n\t\tvar insideEditorSetValue = function( val ) {\n\n\t\t\tvar len = val ? val.length : 0;\n\t\t\tthis.removeAllRows();\n\n\t\t\tif ( len > 0 ) {\n\t\t\t\tfor ( var i = 0; i < val.length; i++ ) {\n\t\t\t\t\tif ( Global.isSet( val[i] ) ) {\n\t\t\t\t\t\tvar row = val[i];\n\t\t\t\t\t\tthis.addRow( row );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.addRow( '' );\n\t\t\t}\n\n\t\t};\n\n\t\t// Commented out due to its use of this._super (no longer valid in ES6 syntax) and it appears not to be used.\n\t\t// var setEditViewDataDone = function() {\n\t\t// \tthis._super( 'setEditViewDataDone' );\n\t\t// \tthis.initInsideEditorData();\n\t\t//\n\t\t// };\n\n\t\tvar initInsideEditorData = function() {\n\t\t\tvar $this = this;\n\n\t\t\tvar args = {};\n\t\t\targs.filter_data = {};\n\t\t\targs.filter_data.hierarchy_control_id = this.current_edit_record.id ? this.current_edit_record.id : ( this.copied_record_id ? this.copied_record_id : '' );\n\n\t\t\tif ( ( !this.current_edit_record || !this.current_edit_record.id ) && !this.copied_record_id ) {\n\t\t\t\tthis.editor.addRow();\n\t\t\t} else {\n\t\t\t\tthis.hierarchy_level_api.getHierarchyLevel( args, true, {\n\t\t\t\t\tonResult: function( res ) {\n\t\t\t\t\t\tif ( !$this.edit_view ) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar data = res.getResult();\n\n\t\t\t\t\t\t$this.editor.setValue( data );\n\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\n\t\t};\n\n\t\tvar insideEditorRemoveRow = function( row ) {\n\t\t\tvar index = row[0].rowIndex - 1;\n\t\t\trow.remove();\n\t\t\tthis.rows_widgets_array.splice( index, 1 );\n\t\t\tthis.removeLastRowLine();\n\t\t};\n\n\t\tvar insideEditorAddRow = function( data ) {\n\t\t\tif ( !data ) {\n\t\t\t\tdata = '';\n\t\t\t}\n\n\t\t\tif ( this.rows_widgets_array.length > 0 && !data ) {\n\t\t\t\tvar current_data = this.rows_widgets_array[this.rows_widgets_array.length - 1].start_date_stamp.getValue();\n\n\t\t\t\tif ( !current_data ) {\n\t\t\t\t\tcurrent_data = new Date();\n\t\t\t\t} else {\n\t\t\t\t\tcurrent_data = Global.strToDate( current_data );\n\t\t\t\t}\n\n\t\t\t\tcurrent_data = new Date( new Date( current_data.getTime() ).setDate( current_data.getDate() + 1 ) );\n\t\t\t\tdata = current_data.format();\n\n\t\t\t} else if ( this.rows_widgets_array.length === 0 && !data ) {\n\t\t\t\tdata = new Date().format();\n\t\t\t}\n\n\t\t\tvar row = this.getRowRender(); //Get Row render\n\t\t\tvar render = this.getRender(); //get render, should be a table\n\t\t\tvar widgets = {}; //Save each row's widgets\n\n\t\t\t//Build row widgets\n\n\t\t\t//Date\n\t\t\tvar form_item_input = Global.loadWidgetByName( FormItemType.DATE_PICKER );\n\t\t\tform_item_input.TDatePicker( {\n\t\t\t\tfield: 'start_date_stamp',\n\t\t\t\tbeforeShow: function() {\n\t\t\t\t\tcan_not_close = true;\n\t\t\t\t},\n\t\t\t\tonClose: function() {\n\t\t\t\t\tcan_not_close = false;\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\t$( '.ranger-picker-dates-width-tr' ).width( form_item_input.width() + 80 );\n\n\t\t\tform_item_input.setValue( data );\n\t\t\twidgets[form_item_input.getField()] = form_item_input;\n\t\t\trow.children().eq( 0 ).append( form_item_input );\n\n\t\t\t$( render ).append( row );\n\n\t\t\tthis.rows_widgets_array.push( widgets );\n\n\t\t\tthis.addIconsEvent( row ); //Bind event to add and minus icon\n\t\t\tthis.removeLastRowLine();\n\t\t};\n\n\t\tvar insideEditorGetValue = function( current_edit_item_id ) {\n\t\t\tvar len = this.rows_widgets_array.length;\n\n\t\t\tvar result = [];\n\n\t\t\tfor ( var i = 0; i < len; i++ ) {\n\t\t\t\tvar row = this.rows_widgets_array[i];\n\t\t\t\tif ( row.start_date_stamp.getValue() ) {\n\t\t\t\t\tresult.push( row.start_date_stamp.getValue() );\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn result;\n\t\t};\n\n\t\tvar show = function() {\n\t\t\tranger_picker = $( Global.loadWidget( 'global/widgets/datepicker/TRangePicker.html' ) );\n\t\t\tvar tab_0_label = ranger_picker.find( 'a[ref=tab_range]' );\n\t\t\tvar tab_1_label = ranger_picker.find( 'a[ref=tab_date]' );\n\t\t\ttab_0_label.text( $.i18n._( 'Range' ) );\n\t\t\ttab_1_label.text( $.i18n._( 'Dates' ) );\n\t\t\trange_start_picker = ranger_picker.find( '#tab_range_content_div' ).find( '.start-picker' );\n\t\t\trange_end_picker = ranger_picker.find( '#tab_range_content_div' ).find( '.end-picker' );\n\t\t\tvar start_picker_label = ranger_picker.find( '#tab_range_content_div' ).find( '.start-picker-label' );\n\t\t\tvar end_picker_label = ranger_picker.find( '#tab_range_content_div' ).find( '.end-picker-label' );\n\t\t\tstart_picker_label.text( $.i18n._( 'Start' ) );\n\t\t\tend_picker_label.text( $.i18n._( 'End' ) );\n\t\t\tvar format = LocalCacheData.getLoginUserPreference().date_format_1;\n\n\t\t\t$.datepicker._gotoToday = function( id ) {\n\t\t\t\tvar target = $( id );\n\t\t\t\tvar inst = this._getInst( target[0] );\n\t\t\t\tif ( this._get( inst, 'gotoCurrent' ) && inst.currentDay ) {\n\t\t\t\t\tinst.selectedDay = inst.currentDay;\n\t\t\t\t\tinst.drawMonth = inst.selectedMonth = inst.currentMonth;\n\t\t\t\t\tinst.drawYear = inst.selectedYear = inst.currentYear;\n\t\t\t\t} else {\n\t\t\t\t\tvar date = new Date();\n\t\t\t\t\tinst.selectedDay = date.getDate();\n\t\t\t\t\tinst.drawMonth = inst.selectedMonth = date.getMonth();\n\t\t\t\t\tinst.drawYear = inst.selectedYear = date.getFullYear();\n\t\t\t\t\t// the below two lines are new\n\t\t\t\t\tthis._setDateDatepicker( target, date );\n\t\t\t\t\tthis._selectDate( id, this._getDateDatepicker( target ) );\n\t\t\t\t\t$( target ).datepicker( 'setDate', date );\n\t\t\t\t}\n\t\t\t\tthis._notifyChange( inst );\n\t\t\t\tthis._adjustDate( target );\n\t\t\t};\n\n\t\t\trange_start_picker.datepicker( {\n\t\t\t\tshowOtherMonths: true,\n\t\t\t\tselectOtherMonths: true,\n\t\t\t\tshowTime: false,\n\t\t\t\tdateFormat: format,\n\t\t\t\tshowHour: false,\n\t\t\t\tshowMinute: false,\n\t\t\t\tchangeMonth: true,\n\t\t\t\tchangeYear: true,\n\t\t\t\tshowButtonPanel: true,\n\t\t\t\tduration: '',\n\t\t\t\tshowAnim: '',\n\t\t\t\tyearRange: '-100:+10',\n\t\t\t\tshowOn: '',\n\t\t\t\tdayNamesMin: [\n\t\t\t\t\t$.i18n._( 'Sun' ), $.i18n._( 'Mon' ), $.i18n._( 'Tue' ),\n\t\t\t\t\t$.i18n._( 'Wed' ), $.i18n._( 'Thu' ), $.i18n._( 'Fri' ), $.i18n._( 'Sat' )\n\t\t\t\t],\n\t\t\t\tcurrentText: $.i18n._( 'Today' ),\n\t\t\t\tmonthNamesShort: [\n\t\t\t\t\t$.i18n._( 'Jan' ), $.i18n._( 'Feb' ),\n\t\t\t\t\t$.i18n._( 'Mar' ), $.i18n._( 'Apr' ), $.i18n._( 'May' ),\n\t\t\t\t\t$.i18n._( 'Jun' ), $.i18n._( 'Jul' ), $.i18n._( 'Aug' ),\n\t\t\t\t\t$.i18n._( 'Sep' ), $.i18n._( 'Oct' ), $.i18n._( 'Nov' ),\n\t\t\t\t\t$.i18n._( 'Dec' )\n\t\t\t\t],\n\t\t\t} );\n\n\t\t\trange_end_picker.datepicker( {\n\t\t\t\tshowOtherMonths: true,\n\t\t\t\tselectOtherMonths: true,\n\t\t\t\tshowTime: false,\n\t\t\t\tdateFormat: format,\n\t\t\t\tshowHour: false,\n\t\t\t\tshowMinute: false,\n\t\t\t\tchangeMonth: true,\n\t\t\t\tchangeYear: true,\n\t\t\t\tshowButtonPanel: true,\n\t\t\t\tduration: '',\n\t\t\t\tshowAnim: '',\n\t\t\t\tyearRange: '-100:+10',\n\t\t\t\tshowOn: '',\n\t\t\t\tdayNamesMin: [\n\t\t\t\t\t$.i18n._( 'Sun' ), $.i18n._( 'Mon' ), $.i18n._( 'Tue' ),\n\t\t\t\t\t$.i18n._( 'Wed' ), $.i18n._( 'Thu' ), $.i18n._( 'Fri' ), $.i18n._( 'Sat' )\n\t\t\t\t],\n\t\t\t\tcurrentText: $.i18n._( 'Today' ),\n\t\t\t\tmonthNamesShort: [\n\t\t\t\t\t$.i18n._( 'Jan' ), $.i18n._( 'Feb' ),\n\t\t\t\t\t$.i18n._( 'Mar' ), $.i18n._( 'Apr' ), $.i18n._( 'May' ),\n\t\t\t\t\t$.i18n._( 'Jun' ), $.i18n._( 'Jul' ), $.i18n._( 'Aug' ),\n\t\t\t\t\t$.i18n._( 'Sep' ), $.i18n._( 'Oct' ), $.i18n._( 'Nov' ),\n\t\t\t\t\t$.i18n._( 'Dec' )\n\t\t\t\t]\n\n\t\t\t} );\n\n\t\t\tvar close_icon = ranger_picker.find( '.close-icon' );\n\n\t\t\tclose_icon.click( function() {\n\t\t\t\t$this.close();\n\t\t\t} );\n\n\t\t\t//Add render in tab 1\n\n\t\t\tvar tab_date = ranger_picker.find( '#tab_date' );\n\n\t\t\tvar inside_editor_div = tab_date.find( '.inside-editor-div' );\n\t\t\tvar args = {\n\t\t\t\tstart_date_stamp: $.i18n._( 'Date' )\n\t\t\t};\n\n\t\t\teditor = Global.loadWidgetByName( FormItemType.INSIDE_EDITOR );\n\n\t\t\teditor = editor.InsideEditor( {\n\t\t\t\ttitle: '',\n\t\t\t\taddRow: insideEditorAddRow,\n\t\t\t\tgetValue: insideEditorGetValue,\n\t\t\t\tsetValue: insideEditorSetValue,\n\t\t\t\tremoveRow: insideEditorRemoveRow,\n\t\t\t\tparent_controller: this,\n\t\t\t\trender: 'global/widgets/datepicker/TRangeInsideEditorRender.html',\n\t\t\t\trender_args: args,\n\t\t\t\tapi: null,\n\t\t\t\trow_render: 'global/widgets/datepicker/TRangeInsideEditorRow.html'\n\t\t\t} );\n\n\t\t\tinside_editor_div.append( editor );\n\n\t\t\teditor.setValue();\n\n\t\t\t$( 'body' ).append( ranger_picker );\n\n\t\t\ttab_bars = $( ranger_picker.find( '.edit-view-tab-bar' ) );\n\n\t\t\ttab_bars = tab_bars.tabs( {\n\t\t\t\tactivate: function( e, ui ) {\n\n\t\t\t\t\tif ( !tab_bars || !tab_bars.is( ':visible' ) ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\tranger_picker.mouseenter( function() {\n\t\t\t\tis_mouse_over = true;\n\t\t\t} );\n\n\t\t\tranger_picker.mouseleave( function() {\n\t\t\t\tis_mouse_over = false;\n\t\t\t} );\n\n\t\t\t//Set Position\n\n\t\t\tvar range_width = ranger_picker.width();\n\n\t\t\tif ( range_width + $( $this ).offset().left + 50 > Global.bodyWidth() ) {\n\t\t\t\tranger_picker.css( 'left', Global.bodyWidth() - range_width - 50 );\n\t\t\t} else {\n\n\t\t\t\tranger_picker.css( 'left', $( $this ).offset().left );\n\t\t\t}\n\n\t\t\tif ( $( $this ).offset().top + 25 + 300 < Global.bodyHeight() ) {\n\t\t\t\tranger_picker.css( 'top', $( $this ).offset().top + 25 );\n\t\t\t} else {\n\t\t\t\tranger_picker.css( 'top', Global.bodyHeight() - 300 );\n\t\t\t}\n\n\t\t\tLocalCacheData.openRangerPicker = $this;\n\n\t\t\tif ( result && ( typeof result == 'string' ) ) {\n\t\t\t\tvar result_array = result.split( ' - ' );\n\t\t\t\trange_start_picker.datepicker( 'setDate', result_array[0] );\n\t\t\t\trange_end_picker.datepicker( 'setDate', result_array[1] );\n\t\t\t} else if ( result && $.type( result ) === 'array' ) {\n\t\t\t\ttab_bars.tabs( 'option', 'active', 1 );\n\n\t\t\t\teditor.setValue( result );\n\t\t\t}\n\n\t\t};\n\n\t\tthis.setPlaceHolder = function( val ) {\n\t\t\tdate_picker_input.attr( 'placeholder', val );\n\t\t};\n\n\t\tthis.each( function() {\n\n\t\t\tvar o = $.meta ? $.extend( {}, opts, $( this ).data() ) : opts;\n\n\t\t\tdate_picker = $( this );\n\n\t\t\tfield = o.field;\n\t\t\tif ( o.validation_field ) {\n\t\t\t\tvalidation_field = o.validation_field;\n\t\t\t}\n\t\t\ticon = $( this ).find( '.t-date-picker-icon' );\n\t\t\tdate_picker_input = $( this ).find( '.t-date-picker' );\n\t\t\ticon.attr( 'src', Global.getRealImagePath( 'images/cal.png' ) );\n\n\t\t\t$this.setPlaceHolder( LocalCacheData.loginUserPreference.date_format_display );\n\n\t\t\tdate_picker_input.change( function() {\n\t\t\t\tif ( check_box ) {\n\t\t\t\t\t$this.setCheckBox( true );\n\t\t\t\t}\n\t\t\t\tresult = [date_picker_input.val()];\n\t\t\t\t$this.trigger( 'formItemChange', [$this] );\n\t\t\t\t$this.autoResize();\n\t\t\t\treturn true;\n\t\t\t} );\n\n\t\t\ticon.bind( 'mouseup', function() { //Need to use 'mouseup' event as main.js binds 'mousedown' for closing when clicked off.\n\t\t\t\tif ( !enabled ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( !is_open ) {\n\t\t\t\t\tshow();\n\t\t\t\t\tis_open = true;\n\t\t\t\t} else {\n\t\t\t\t\t$this.close();\n\t\t\t\t\tis_open = false;\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t\tdate_picker_input.mouseover( function() {\n\n\t\t\t\tif ( enabled ) {\n\t\t\t\t\tif ( error_string && error_string.length > 0 ) {\n\t\t\t\t\t\t$this.showErrorTip( 20 );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t\tdate_picker_input.mouseout( function() {\n\t\t\t\tif ( !$( $this ).is( ':focus' ) ) {\n\t\t\t\t\t$this.hideErrorTip();\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\t$this.autoResize();\n\n\t\t} );\n\n\t\treturn this;\n\n\t};\n\n\t$.fn.TRangePicker.defaults = {};\n\n} )( jQuery );\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTMwMC5qcyIsIm1hcHBpbmdzIjoiO0FBQUE7O0FBRUE7QUFDQSx5QkFBeUI7QUFDekI7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBOztBQUVBOztBQUVBOztBQUVBOztBQUVBOztBQUVBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxLQUFLO0FBQ0w7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBLE1BQU07O0FBRU4sS0FBSztBQUNMO0FBQ0E7QUFDQTtBQUNBO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