(function(){"use strict";var e=/([0-9\?\*]+)|([^0-9\?\*]+)/g;var r=/(\%[YMDymd])|([^\%]+)/g;var i=/^\d{4}-[01]\d-[0-3]\d$/;var n=/^([0-2]\d:[0-5]\d:[0-5]\d)$|^([0-2]\d:[0-5]\d)$/;u8.Mobile.tools={convertToIsoDate:function(n){if(!n){return undefined}if(n.match(i)){return n}if(!u8.session||!u8.session.localeSettings){return undefined}var t=u8.session.localeSettings.dateFormat;var s=t.match(r);var a=n.match(e);var u="";var f="";var d="";for(var o=0;o<s.length;o++){var v=s[o];var l=a[o];if(v=="%Y"||v=="%y"){u=l}else if(v=="%M"||v=="%m"){f=l}else if(v=="%D"||v=="%d"){d=l}}return u+"-"+f+"-"+d},convertToIsoTime:function(e){if(!e){return undefined}if(e.match(n)){return e}if(!u8.session||!u8.session.localeSettings){return undefined}var r=u8.session.localeSettings.amPm;var i=e.toUpperCase().indexOf("AM");var t=e.toUpperCase().indexOf("PM");if((i>-1||t>-1)&&!r){return undefined}var s=false;if(i>-1){e=e.substring(0,i)}else if(t>-1){s=true;e=e.substring(0,t)}var a=u8.session.localeSettings.timeSeparator||":";var u=e.split(a);if(e.length<2){return undefined}var f=Number(u[0]);if(isNaN(f)){return undefined}if(r){if(f==12){f=s?12:0}else if(s){f=f+12}}var d=Number(u[1]);if(isNaN(d)){return undefined}var o;if(u.length>2){o=Number(u[2]);if(isNaN(o)){return undefined}}else{o=""}return this.getFormattedTimeString(f,d,o)},getFormattedTimeString:function(e,r,i){if(e<10){e="0"+e}if(r<10){r="0"+r}if(i!=""&&i<10){i="0"+i}return e+":"+r+(i!=""?":"+i:"")}}})();