| Server IP : 54.36.91.62 / Your IP : 216.73.217.112 Web Server : Apache System : Linux webm013.cluster127.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : coopiak ( 151928) PHP Version : 8.3.23 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/coopiak/amisdesseniors-fr/nimes/components/com_comprofiler/js/jquery/ |
Upload File : |
(function(a){var n=function(t,e){this.$element=a(t);if(!this.$element.is("input")){a.error("Combodate should be applied to INPUT element");return}this.options=a.extend({},a.fn.combodate.defaults,e,this.$element.data());this.init()};n.prototype={constructor:n,init:function(){this.map={day:["D","date"],month:["M","month"],year:["Y","year"],hour:["[Hh]","hours"],minute:["m","minutes"],second:["s","seconds"],ampm:["[Aa]",""]};this.$widget=a('<span class="combodate"></span>').html(this.getTemplate());this.initCombos();this.datetime=null;this.$widget.on("change","select",a.proxy(function(t){this.$element.val(this.getValue()).change();if(this.options.smartDays){if(a(t.target).is(".month")||a(t.target).is(".year")){this.fillCombo("day")}}},this));this.$widget.find("select").css("width","auto");this.$element.hide().after(this.$widget);this.setValue(this.$element.val()||this.options.value)},getTemplate:function(){var o=this.options.template;var s=this.$element.prop("disabled");var n=this.options.customClass;a.each(this.map,function(t,e){e=e[0];var i=new RegExp(e+"+"),s=e.length>1?e.substring(1,2):e;o=o.replace(i,"{"+s+"}")});o=o.replace(/ /g," ");a.each(this.map,function(t,e){e=e[0];var i=e.length>1?e.substring(1,2):e;o=o.replace("{"+i+"}",'<select class="'+t+" "+n+'"'+(s?' disabled="disabled"':"")+"></select>")});return o},initCombos:function(){for(var t in this.map){var e=this.$widget.find("."+t);this["$"+t]=e.length?e:null;this.fillCombo(t)}},fillCombo:function(t){var e=this["$"+t];if(!e){return}var i="fill"+t.charAt(0).toUpperCase()+t.slice(1);var s=this[i]();var o=e.val();e.empty();for(var n=0;n<s.length;n++){e.append('<option value="'+s[n][0]+'">'+s[n][1]+"</option>")}e.val(o)},fillCommon:function(t){var e=[],i;if(this.options.firstItem==="name"){if(moment.localeData){i=moment.localeData()._relativeTime}else{i=moment.relativeTime||moment.langData()._relativeTime}var s=typeof i[t]==="function"?i[t](1,true,t,false):i[t];s=s.split(" ").reverse()[0];e.push(["",s])}else if(this.options.firstItem==="empty"){e.push(["",""])}return e},fillDay:function(){var t=this.fillCommon("d"),e,i,s=this.options.template.indexOf("DD")!==-1,o=31;if(this.options.smartDays&&this.$month&&this.$year){var n=parseInt(this.$month.val(),10);var a=parseInt(this.$year.val(),10);if(!isNaN(n)&&!isNaN(a)){o=moment([a,n]).daysInMonth()}}for(i=1;i<=o;i++){e=s?this.leadZero(i):i;t.push([i,e])}return t},fillMonth:function(){var t=this.fillCommon("M"),e,i,s=this.options.template.indexOf("MMMMMM")!==-1,o=this.options.template.indexOf("MMMMM")!==-1,n=this.options.template.indexOf("MMMM")!==-1,a=this.options.template.indexOf("MMM")!==-1,r=this.options.template.indexOf("MM")!==-1;for(i=0;i<=11;i++){if(s){e=moment().date(1).month(i).format("MM - MMMM")}else if(o){e=moment().date(1).month(i).format("MM - MMM")}else if(n){e=moment().date(1).month(i).format("MMMM")}else if(a){e=moment().date(1).month(i).format("MMM")}else if(r){e=this.leadZero(i+1)}else{e=i+1}t.push([i,e])}return t},fillYear:function(){var t=[],e,i,s=this.options.template.indexOf("YYYY")!==-1;for(i=this.options.maxYear;i>=this.options.minYear;i--){e=s?i:(i+"").substring(2);t[this.options.yearDescending?"push":"unshift"]([i,e])}t=this.fillCommon("y").concat(t);return t},fillHour:function(){var t=this.fillCommon("h"),e,i,s=this.options.template.indexOf("h")!==-1,o=this.options.template.indexOf("H")!==-1,n=this.options.template.toLowerCase().indexOf("hh")!==-1,a=s?1:0,r=s?12:23;for(i=a;i<=r;i++){e=n?this.leadZero(i):i;t.push([i,e])}return t},fillMinute:function(){var t=this.fillCommon("m"),e,i,s=this.options.template.indexOf("mm")!==-1;for(i=0;i<=59;i+=this.options.minuteStep){e=s?this.leadZero(i):i;t.push([i,e])}return t},fillSecond:function(){var t=this.fillCommon("s"),e,i,s=this.options.template.indexOf("ss")!==-1;for(i=0;i<=59;i+=this.options.secondStep){e=s?this.leadZero(i):i;t.push([i,e])}return t},fillAmpm:function(){var t=this.options.template.indexOf("a")!==-1,e=this.options.template.indexOf("A")!==-1,i=[["am",t?"am":"AM"],["pm",t?"pm":"PM"]];return i},getValue:function(t){var e,s={},o=this,n=false;a.each(this.map,function(t,e){if(t==="ampm"){return}if(o["$"+t]){s[t]=parseInt(o["$"+t].val(),10)}else{var i;if(o.datetime){i=o.datetime[e[1]]()}else{i=t==="day"?1:0}s[t]=i}if(isNaN(s[t])){n=true;return false}});if(n){return""}if(this.$ampm){if(s.hour===12){s.hour=this.$ampm.val()==="am"?0:12}else{s.hour=this.$ampm.val()==="am"?s.hour:s.hour+12}}e=moment([s.year,s.month,s.day,s.hour,s.minute,s.second]);this.highlight(e);t=t===undefined?this.options.format:t;if(t===null){return e.isValid()?e:null}else{return e.isValid()?e.format(t):""}},setValue:function(t){if(!t){return}var i=typeof t==="string"?moment(t,this.options.format,true):moment(t),s=this,o={};function n(t,o){var n={};t.children("option").each(function(t,e){var i=a(e).attr("value"),s;if(i==="")return;s=Math.abs(i-o);if(typeof n.distance==="undefined"||s<n.distance){n={value:i,distance:s}}});return n.value}if(i.isValid()){a.each(this.map,function(t,e){if(t==="ampm"){return}o[t]=i[e[1]]()});if(this.$ampm){if(o.hour>=12){o.ampm="pm";if(o.hour>12){o.hour-=12}}else{o.ampm="am";if(o.hour===0){o.hour=12}}}a.each(o,function(t,e){if(s["$"+t]){if(t==="minute"&&s.options.minuteStep>1&&s.options.roundTime){e=n(s["$"+t],e)}if(t==="second"&&s.options.secondStep>1&&s.options.roundTime){e=n(s["$"+t],e)}s["$"+t].val(e)}});if(this.options.smartDays){this.fillCombo("day")}this.$element.val(i.format(this.options.format)).change();this.datetime=i}else{this.datetime=null}},highlight:function(t){if(!t.isValid()){if(this.options.errorClass){this.$widget.addClass(this.options.errorClass)}else{if(!this.borderColor){this.borderColor=this.$widget.find("select").css("border-color")}this.$widget.find("select").css("border-color","red")}}else{if(this.options.errorClass){this.$widget.removeClass(this.options.errorClass)}else{this.$widget.find("select").css("border-color",this.borderColor)}}},leadZero:function(t){return t<=9?"0"+t:t},destroy:function(){this.$widget.remove();this.$element.removeData("combodate").show()}};a.fn.combodate=function(s){var t,o=Array.apply(null,arguments);o.shift();if(s==="getValue"&&this.length&&(t=this.eq(0).data("combodate"))){return t.getValue.apply(t,o)}return this.each(function(){var t=a(this),e=t.data("combodate"),i=typeof s=="object"&&s;if(!e){t.data("combodate",e=new n(this,i))}if(typeof s=="string"&&typeof e[s]=="function"){e[s].apply(e,o)}})};a.fn.combodate.defaults={format:"DD-MM-YYYY HH:mm",template:"D / MMM / YYYY H : mm",value:null,minYear:1970,maxYear:(new Date).getFullYear(),yearDescending:true,minuteStep:5,secondStep:1,firstItem:"empty",errorClass:null,customClass:"",roundTime:true,smartDays:false}})(window.jQuery);