PageSourceSearch

https://davidsonsgroup.co.uk/wp-content/plugins/bookly-responsive-…/resources/js/picker.date.js?ver=22.3.1

js davidsonsgroup.co.uk collected 2026-09-25 04:22:03 UTC 12,780 bytes, 5 lines download raw bytes

1/*!
2 * Date picker for pickadate.js v3.6.4
3 * http://amsul.github.io/pickadate.js/date.htm
4 */
5!function(e){"function"==typeof define&&define.amd?define(["./picker","jquery"],e):"object"==typeof exports?module.exports=e(require("./picker.js"),require("jquery")):e(Picker,jQuery)}(function(e,f){var t,g=e._;function a(t,a){function e(){return r.currentStyle?"rtl"==r.currentStyle.direction:"rtl"==getComputedStyle(t.$root[0]).direction}var n,i=this,r=t.$node[0],o=r.value,s=t.$node.data("value"),l=s||o,c=s?a.formatSubmit:a.format;i.settings=a,i.$node=t.$node,i.queue={min:"measure create",max:"measure create",now:"now create",select:"parse create validate",highlight:"parse navigate create validate",view:"parse create validate viewset",disable:"deactivate",enable:"activate"},i.item={},i.item.clear=null,i.item.disable=(a.disable||[]).slice(0),i.item.enable=-(!0===(n=i.item.disable)[0]?n.shift():-1),i.set("min",a.min).set("max",a.max).set("now"),l?i.set("select",l,{format:c,defaultValue:!0}):i.set("select",null).set("highlight",i.item.now),i.key={40:7,38:-7,39:function(){return e()?-1:1},37:function(){return e()?1:-1},go:function(e){var t=i.item.highlight,a=new Date(t.year,t.month,t.date+e);i.set("highlight",a,{interval:e}),this.render()}},t.on("render",function(){t.$root.find("."+a.klass.selectMonth).on("change",function(){var e=this.value;e&&(t.set("highlight",[t.get("view").year,e,t.get("highlight").date]),t.$root.find("."+a.klass.selectMonth).trigger("focus"))}),t.$root.find("."+a.klass.selectYear).on("change",function(){var e=this.value;e&&(t.set("highlight",[e,t.get("view").month,t.get("highlight").date]),t.$root.find("."+a.klass.selectYear).trigger("focus"))})},1).on("open",function(){var e="";i.disabled(i.get("now"))&&(e=":not(."+a.klass.buttonToday+")"),t.$root.find("button"+e+", select").attr("disabled",!1)},1).on("close",function(){t.$root.find("button, select").attr("disabled",!0)},1)}function n(e,t,a){var n=e.match(/[^\x00-\x7F]+|[a-zA-Z0-9_\u0080-\u00FF]+/)[0];return a.mm||a.m||(a.m=t.indexOf(n)+1),n.length}function i(e){return e.match(/[a-zA-Z0-9_\u0080-\u00FF]+/)[0].length}a.prototype.set=function(t,a,n){var i=this,e=i.item;return null===a?("clear"==t&&(t="select"),e[t]=a):(e["enable"==t?"disable":"flip"==t?"enable":t]=i.queue[t].split(" ").map(function(e){return a=i[e](t,a,n)}).pop(),"select"==t?i.set("highlight",e.select,n):"highlight"==t?i.set("view",e.highlight,n):t.match(/^(flip|min|max|disable|enable)$/)&&(e.select&&i.disabled(e.select)&&i.set("select",e.select,n),e.highlight&&i.disabled(e.highlight)&&i.set("highlight",e.highlight,n))),i},a.prototype.get=function(e){return this.item[e]},a.prototype.create=function(e,t,a){var n,i=this;return(t=void 0===t?e:t)==-1/0||t==1/0?n=t:t=f.isPlainObject(t)&&g.isInteger(t.pick)?t.obj:f.isArray(t)?(t=new Date(t[0],t[1],t[2]),g.isDate(t)?t:i.create().obj):g.isInteger(t)||g.isDate(t)?i.normalize(new Date(t),a):i.now(e,t,a),{year:n||t.getFullYear(),month:n||t.getMonth(),date:n||t.getDate(),day:n||t.getDay(),obj:n||t,pick:n||t.getTime()}},a.prototype.createRange=function(e,t){function a(e){return!0===e||f.isArray(e)||g.isDate(e)?n.create(e):e}var n=this;return g.isInteger(e)||(e=a(e)),g.isInteger(t)||(t=a(t)),g.isInteger(e)&&f.isPlainObject(t)?e=[t.year,t.month,t.date+e]:g.isInteger(t)&&f.isPlainObject(e)&&(t=[e.year,e.month,e.date+t]),{from:a(e),to:a(t)}},a.prototype.withinRange=function(e,t){return e=this.createRange(e.from,e.to),t.pick>=e.from.pick&&t.pick<=e.to.pick},a.prototype.overlapRanges=function(e,t){var a=this;return e=a.createRange(e.from,e.to),t=a.createRange(t.from,t.to),a.withinRange(e,t.from)||a.withinRange(e,t.to)||a.withinRange(t,e.from)||a.withinRange(t,e.to)},a.prototype.now=function(e,t,a){return t=new Date,a&&a.rel&&t.setDate(t.getDate()+a.rel),this.normalize(t,a)},a.prototype.navigate=function(e,t,a){var n,i,r,o,s=f.isArray(t),l=f.isPlainObject(t),c=this.item.view;if(s||l){for(o=l?(i=t.year,r=t.month,t.date):(i=+t[0],r=+t[1],+t[2]),a&&a.nav&&c&&c.month!==r&&(i=c.year,r=c.month),i=(n=new Date(i,r+(a&&a.nav?a.nav:0),1)).getFullYear(),r=n.getMonth();new Date(i,r,o).getMonth()!==r;)--o;t=[i,r,o]}return t},a.prototype.normalize=function(e){return e.setHours(0,0,0,0),e},a.prototype.measure=function(e,t){return g.isInteger(t)?t=this.now(e,t,{rel:t}):t?"string"==typeof t&&(t=this.parse(e,t)):t="min"==e?-1/0:1/0,t},a.prototype.viewset=function(e,t){return this.create([t.year,t.month,1])},a.prototype.validate=function(e,a,t){var n,i,r,o,s=this,l=a,c=t&&t.interval?t.interval:1,d=-1===s.item.enable,u=s.item.min,h=s.item.max,m=d&&s.item.disable.filter(function(e){var t;return f.isArray(e)&&((t=s.create(e).pick)<a.pick?n=!0:t>a.pick&&(i=!0)),g.isInteger(e)}).length;if((!t||!t.nav&&!t.defaultValue)&&(!d&&s.disabled(a)||d&&s.disabled(a)&&(m||n||i)||!d&&(a.pick<=u.pick||a.pick>=h.pick)))for(d&&!m&&(!i&&0<c||!n&&c<0)&&(c*=-1);s.disabled(a)&&(1<Math.abs(c)&&(a.month<l.month||a.month>l.month)&&(a=l,c=0<c?1:-1),a.pick<=u.pick?(r=!0,c=1,a=s.create([u.year,u.month,u.date+(a.pick===u.pick?0:-1)])):a.pick>=h.pick&&(o=!0,c=-1,a=s.create([h.year,h.month,h.date+(a.pick===
5h.pick?0:1)])),!r||!o);)a=s.create([a.year,a.month,a.date+c]);return a},a.prototype.disabled=function(t){var a=this,e=(e=a.item.disable.filter(function(e){return g.isInteger(e)?t.day===(e-a.settings.firstDay)%7:f.isArray(e)||g.isDate(e)?t.pick===a.create(e).pick:f.isPlainObject(e)?a.withinRange(e,t):void 0})).length&&!e.filter(function(e){return f.isArray(e)&&"inverted"==e[3]||f.isPlainObject(e)&&e.inverted}).length;return-1===a.item.enable?!e:e||t.pick<a.item.min.pick||t.pick>a.item.max.pick},a.prototype.parse=function(e,n,t){var i=this,r={};return n&&"string"==typeof n?(t&&t.format||((t=t||{}).format=i.settings.format),i.formats.toArray(t.format).map(function(e){var t=i.formats[e],a=t?g.trigger(t,i,[n,r]):e.replace(/^!/,"").length;t&&(r[e]=n.substr(0,a)),n=n.substr(a)}),[r.yyyy||r.yy,(r.mm||r.m)-1,r.dd||r.d]):n},a.prototype.formats={d:function(e,t){return e?g.digits(e):t.date},dd:function(e,t){return e?2:g.lead(t.date)},ddd:function(e,t){return e?i(e):this.settings.weekdaysShort[t.day]},dddd:function(e,t){return e?i(e):this.settings.weekdaysFull[t.day]},m:function(e,t){return e?g.digits(e):t.month+1},mm:function(e,t){return e?2:g.lead(t.month+1)},mmm:function(e,t){var a=this.settings.monthsShort;return e?n(e,a,t):a[t.month]},mmmm:function(e,t){var a=this.settings.monthsFull;return e?n(e,a,t):a[t.month]},yy:function(e,t){return e?2:(""+t.year).slice(2)},yyyy:function(e,t){return e?4:t.year},toArray:function(e){return e.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g)},toString:function(e,t){var a=this;return a.formats.toArray(e).map(function(e){return g.trigger(a.formats[e],a,[0,t])||e.replace(/^!/,"")}).join("")}},a.prototype.isDateExact=function(e,t){return g.isInteger(e)&&g.isInteger(t)||"boolean"==typeof e&&"boolean"==typeof t?e===t:(g.isDate(e)||f.isArray(e))&&(g.isDate(t)||f.isArray(t))?this.create(e).pick===this.create(t).pick:!(!f.isPlainObject(e)||!f.isPlainObject(t))&&(this.isDateExact(e.from,t.from)&&this.isDateExact(e.to,t.to))},a.prototype.isDateOverlap=function(e,t){var a=this.settings.firstDay;return g.isInteger(e)&&(g.isDate(t)||f.isArray(t))?(e=(e+a)%7+1)===this.create(t).day+1:g.isInteger(t)&&(g.isDate(e)||f.isArray(e))?(t=(t+a)%7+1)===this.create(e).day+1:!(!f.isPlainObject(e)||!f.isPlainObject(t))&&this.overlapRanges(e,t)},a.prototype.flipEnable=function(e){var t=this.item;t.enable=e||(-1==t.enable?1:-1)},a.prototype.deactivate=function(e,t){var n=this,i=n.item.disable.slice(0);return"flip"==t?n.flipEnable():!1===t?(n.flipEnable(1),i=[]):!0===t?(n.flipEnable(-1),i=[]):t.map(function(e){for(var t,a=0;a<i.length;a+=1)if(n.isDateExact(e,i[a])){t=!0;break}t||(g.isInteger(e)||g.isDate(e)||f.isArray(e)||f.isPlainObject(e)&&e.from&&e.to)&&i.push(e)}),i},a.prototype.activate=function(e,t){var r=this,o=r.item.disable,s=o.length;return"flip"==t?r.flipEnable():!0===t?(r.flipEnable(1),o=[]):!1===t?(r.flipEnable(-1),o=[]):t.map(function(e){for(var t,a,n,i=0;i<s;i+=1){if(a=o[i],r.isDateExact(a,e)){n=!(t=o[i]=null);break}if(r.isDateOverlap(a,e)){f.isPlainObject(e)?(e.inverted=!0,t=e):f.isArray(e)?(t=e)[3]||t.push("inverted"):g.isDate(e)&&(t=[e.getFullYear(),e.getMonth(),e.getDate(),"inverted"]);break}}if(t)for(i=0;i<s;i+=1)if(r.isDateExact(o[i],e)){o[i]=null;break}if(n)for(i=0;i<s;i+=1)if(r.isDateOverlap(o[i],e)){o[i]=null;break}t&&o.push(t)}),o.filter(function(e){return null!=e})},a.prototype.nodes=function(l){function e(e){return g.node("div"," ",d.klass["nav"+(e?"Next":"Prev")]+(e&&m.year>=y.year&&m.month>=y.month||!e&&m.year<=p.year&&m.month<=p.month?" "+d.klass.navDisabled:""),"data-nav="+(e||-1)+' tabindex="0" '+g.ariaAttr({role:"button",controls:c.$node[0].id+"_table"})+' title="'+(e?d.labelMonthNext:d.labelMonthPrev)+'"')}function t(){var t=d.showMonthsShort?d.monthsShort:d.monthsFull;return d.selectMonths?g.node("select",g.group({min:0,max:11,i:1,node:"option",item:function(e){return[t[e],0,"value="+e+(m.month==e?" selected":"")+(m.year==p.year&&e<p.month||m.year==y.year&&e>y.month?" disabled":"")]}}),d.klass.selectMonth,(l?"":"disabled")+" "+g.ariaAttr({controls:c.$node[0].id+"_table"})+' title="'+d.labelMonthSelect+'"'):g.node("div",t[m.month],d.klass.month)}function a(){var t=m.year,e=!0===d.selectYears?5:~~(d.selectYears/2);if(e){var a,n,i=p.year,r=y.year,o=t-e,s=t+e;return o<i&&(s+=i-o,o=i),r<s&&(o-=(n=s-r)<(a=o-i)?n:a,s=r),g.node("select",g.group({min:o,max:s,i:1,node:"option",item:function(e){return[e,0,"value="+e+(t==e?" selected":"")]}}),d.klass.selectYear,(l?"":"disabled")+" "+g.ariaAttr({controls:c.$node[0].id+"_table"})+' title="'+d.labelYearSelect+'"')}return g.node("div",t,d.klass.year)}var c=this,d=c.settings,n=c.item,s=n.now,u=n.select,h=n.highlight,m=n.view,f=n.disable,p=n.min,y=n.max,i=function(t,a){for(var e=0;e<d.firstDay;e++)t.push(t.shift()),a.push(a.shift());return g.node("thead",g.node("tr",g.group({min:0,max:6,i:1,node:"th",item:function(e){return[t[e],d.klass.weekdays,'scope=col title="'+a[e]+'"']}})))}((d.showWeekdaysFull?d.weekdaysFull:d.weekdaysShort).slice(0),d.weekdaysFull.slice(0));return g.node("div",(d.selectYears?a()+t():t()+a())+e()+e(1),d.klass.header)+g.node("table",i+g.node("tbody",g.group({min:0,max:5,i:1,node:"tr",item:function(e){var t=c.create([m.year,m.month,1]).day<d.firstDay?-7:0;return[g.group({min:7*e-m.day+t+1,max:function(){return this.min+7-1},i:1,node:"td",item:function(e){e=c.create([m.year,m.month,e+d.firstDay]);var t,a=u&&u.pick==e.pick,n=h&&h.pick==e.pick,i=f&&c.disabled(e)||e.pick<p.pick||e.pick>y.pick,r=g.trigger(c.formats.toString,c,[d.format,e]),o=d.id+"_"+e.pick;return[g.node("div",e.date,((t=[d.klass.day]).push(m.month==e.month?d.klass.infocus:d.klass.outfocus),s.pick==e.pick&&t.push(d.klass.now),a&&t.push(d.klass.selected),n&&t.push(d.klass.highlighted),i&&t.push(d.klass.disabled),t.join(" ")),"data-pick="+e.pick+" id="+o+' tabindex="0" '+g.ariaAttr({role:"gridcell",label:r,selected:!(!a||c.$node.val()!==r)||null,activedescendant:n?e.pick:null,disabled:!!i||null})),""]}})]}})),d.klass.table,'id="'+c.$node[0].id+'_table" '+g.ariaAttr({role:"grid",controls:c.$node[0].id,readonly:!0}))+g.node("div",g.node("button",d.today,d.klass.buttonToday,"type=button data-
5pick="+s.pick+(l&&!c.disabled(s)?"":" disabled")+" "+g.ariaAttr({controls:c.$node[0].id}))+g.node("button",d.clear,d.klass.buttonClear,"type=button data-clear=1"+(l?"":" disabled")+" "+g.ariaAttr({controls:c.$node[0].id}))+g.node("button",d.close,d.klass.buttonClose,"type=button data-close=true "+(l?"":" disabled")+" "+g.ariaAttr({controls:c.$node[0].id})),d.klass.footer)},a.defaults={labelMonthNext:"Next month",labelMonthPrev:"Previous month",labelMonthSelect:"Select a month",labelYearSelect:"Select a year",monthsFull:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdaysFull:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],today:"Today",clear:"Clear",close:"Close",closeOnSelect:!0,closeOnClear:!0,updateInput:!0,format:"d mmmm, yyyy",klass:{table:(t=e.klasses().picker+"__")+"table",header:t+"header",navPrev:t+"nav--prev",navNext:t+"nav--next",navDisabled:t+"nav--disabled",month:t+"month",year:t+"year",selectMonth:t+"select--month",selectYear:t+"select--year",weekdays:t+"weekday",day:t+"day",disabled:t+"day--disabled",selected:t+"day--selected",highlighted:t+"day--highlighted",now:t+"day--today",infocus:t+"day--infocus",outfocus:t+"day--outfocus",footer:t+"footer",buttonClear:t+"button--clear",buttonToday:t+"button--today",buttonClose:t+"button--close"}},e.extend("pickadate",a)});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.