// All material copyright ESRI, All Rights Reserved, unless otherwise specified.// See https://js.arcgis.com/4.6/esri/copyright.txt for details.//>>builtdefine("./Widgette dojo/_base/lang dojo/date/locale dojo/keys ../renderers/support/utils dijit/form/_DateTimeTextBox dijit/form/ValidationTextBox".split(" "),function(m,g,h,n,k,l,p){returnm.createSubclass([p],{declaredClass:"esri.widgets.DateTimeTextBox",properties:{visible:!0,value:null,date:null},_timeSeparator:", ",_dateFormatOptions:{dateOptions:{formatLength:"short",selector:"date",fullYear:!0},timeOptions:{formatLength:"short",selector:"time"}},constructor:function(a,b){this._getValidDateTimeRE=g.hitch(this,this._getValidDateTimeRE);this.set("pattern",this._getValidDateTimeRE);this.set("invalidMessage",this._getInvalidMessage())},postCreate:function(){this.inherited(arguments);this.set("value",this.date);this.own(this.watch("date",g.hitch(this,this._dateChangeHandler)),this.on("change",g.hitch(this,this._valueChangeHandler)),this.on("keydown",g.hitch(this,this._keydownHandler)))},format:function(a){returnthis._formatDate(a)},parse:function(a,b){a=this._parseDateString(a,b);returna.isValid?newDate(a.value):void0},compare:l.prototype.compare,_isInvalidDate:l.prototype._isInvalidDate,_dateChangeHandler:function(a,b,d){this.date!==this.value&&this.set("value",d)},_valueChangeHandler:function(a){this.isValid()&&this.set("date",a)},_keydownHandler:function(a){a.keyCode===n.ENTER&&this._commitValueToDate()},_commitValueToDate:function(){vara=this._parseDateString(this.textbox.value);a.isValid&&this.set("value",newDate(a.value))},_formatDate:function(a){varb="";ainstanceofDate&&(a=a.getTime());"number"!==typeofa||isNaN(a)||(b=k.formatDate(a,{selector:"date",dateOptions:this._dateFormatOptions.dateOptions}),a=k.formatDate(a,{selector:"time",timeOptions:this._dateFormatOptions.timeOptions}),b=this._mergeDateTime(b,a));returnb},_parseDateString:function(a,b){b=b||{};vard=(a||"").split(this._timeSeparator);a=d[1];varc=h.parse(d[0],this._dateFormatOptions.dateOptions),d=h.parse(a,this._dateFormatOptions.timeOptions),e=!1,f=b.min;b=b.max;c=c&&c.getTime();"number"!==typeofc||isNaN(c)?c=null:d?(a=d&&d.getTime(),"number"!==typeofa||isNaN(a)||(a-=6E4*d.getTimezoneOffset(),c+=a,e=!0)):e=!a;e&&(f=f&&f.getTime(),b=b&&b.getTime(),"number"!==typeoff||isNaN(f)||c<f&&(e=!1),"number"!==typeofb||isNaN(b)||c>b&&(e=!1));return{isValid:e,value:c}},_getValidDateTimeRE:function(){vara=h.regexp(this._dateFormatOptions.dateOptions),b=h.regexp(this._dateFormatOptions.timeOptions);returna+"(,\\s"+b+")?"},_getInvalidMessage:function(){returnthis._formatDate(newDate(0))},_mergeDateTime:function(a,b){returna+(b?this._timeSeparator+b:"")}})});