From 9aa370ddfd1eac1ef5552e02a060f017399f3883 Mon Sep 17 00:00:00 2001
From: Alexandre <8642690+alexandrevega@users.noreply.github.com>
Date: Mon, 18 Sep 2023 14:33:27 +0000
Subject: [PATCH 1/3] Remove forcing altInput and date formats
---
resources/js/components/flatpickr.js | 6 +++---
.../js/dist/components/flatpickr-component.js | 2 +-
src/Forms/Components/Flatpickr.php | 18 ++++++++++++------
3 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/resources/js/components/flatpickr.js b/resources/js/components/flatpickr.js
index c5340a2..e63e99f 100644
--- a/resources/js/components/flatpickr.js
+++ b/resources/js/components/flatpickr.js
@@ -48,12 +48,12 @@ export default function flatpickrDatepicker(args) {
el.href = this.attribs.darkThemeAsset;
}
}
+
if (this.attribs.monthSelect) {
config.plugins.push(new MonthSelect({
shorthand: false, //defaults to false
- dateFormat: "F Y", //defaults to "F Y"
- altInput: true,
- altFormat: "F, Y", //defaults to "F Y"
+ dateFormat: args.packageConfig.dateFormat ?? "F Y", //defaults to "F Y"
+ altInput: args.packageConfig.altInput ?? true,
theme: this.mode // defaults to "light"
}))
} else if (this.attribs.weekSelect) {
diff --git a/resources/js/dist/components/flatpickr-component.js b/resources/js/dist/components/flatpickr-component.js
index c884800..4247933 100644
--- a/resources/js/dist/components/flatpickr-component.js
+++ b/resources/js/dist/components/flatpickr-component.js
@@ -2,4 +2,4 @@ var De=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChang
`+t.join("")+`
- `}}function fn(){e.calendarContainer.classList.add("hasWeeks");var n=y("div","flatpickr-weekwrapper");n.appendChild(y("span","flatpickr-weekday",e.l10n.weekAbbreviation));var t=y("div","flatpickr-weeks");return n.appendChild(t),{weekWrapper:n,weekNumbers:t}}function Ee(n,t){t===void 0&&(t=!0);var i=t?n:n-e.currentMonth;i<0&&e._hidePrevMonthArrow===!0||i>0&&e._hideNextMonthArrow===!0||(e.currentMonth+=i,(e.currentMonth<0||e.currentMonth>11)&&(e.currentYear+=e.currentMonth>11?1:-1,e.currentMonth=(e.currentMonth+12)%12,S("onYearChange"),X()),fe(),S("onMonthChange"),ve())}function dn(n,t){if(n===void 0&&(n=!0),t===void 0&&(t=!0),e.input.value="",e.altInput!==void 0&&(e.altInput.value=""),e.mobileInput!==void 0&&(e.mobileInput.value=""),e.selectedDates=[],e.latestSelectedDateObj=void 0,t===!0&&(e.currentYear=e._initialDate.getFullYear(),e.currentMonth=e._initialDate.getMonth()),e.config.enableTime===!0){var i=xe(e.config),o=i.hours,l=i.minutes,s=i.seconds;P(o,l,s)}e.redraw(),n&&S("onChange")}function mn(){e.isOpen=!1,e.isMobile||(e.calendarContainer!==void 0&&e.calendarContainer.classList.remove("open"),e._input!==void 0&&e._input.classList.remove("active")),S("onClose")}function gn(){e.config!==void 0&&S("onDestroy");for(var n=e._handlers.length;n--;)e._handlers[n].remove();if(e._handlers=[],e.mobileInput)e.mobileInput.parentNode&&e.mobileInput.parentNode.removeChild(e.mobileInput),e.mobileInput=void 0;else if(e.calendarContainer&&e.calendarContainer.parentNode)if(e.config.static&&e.calendarContainer.parentNode){var t=e.calendarContainer.parentNode;if(t.lastChild&&t.removeChild(t.lastChild),t.parentNode){for(;t.firstChild;)t.parentNode.insertBefore(t.firstChild,t);t.parentNode.removeChild(t)}}else e.calendarContainer.parentNode.removeChild(e.calendarContainer);e.altInput&&(e.input.type="text",e.altInput.parentNode&&e.altInput.parentNode.removeChild(e.altInput),delete e.altInput),e.input&&(e.input.type=e.input._type,e.input.classList.remove("flatpickr-input"),e.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(i){try{delete e[i]}catch{}})}function ie(n){return e.calendarContainer.contains(n)}function Se(n){if(e.isOpen&&!e.config.inline){var t=L(n),i=ie(t),o=t===e.input||t===e.altInput||e.element.contains(t)||n.path&&n.path.indexOf&&(~n.path.indexOf(e.input)||~n.path.indexOf(e.altInput)),l=!o&&!i&&!ie(n.relatedTarget),s=!e.config.ignoredFocusElements.some(function(v){return v.contains(t)});l&&s&&(e.config.allowInput&&e.setDate(e._input.value,!1,e.config.altInput?e.config.altFormat:e.config.dateFormat),e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0&&e.input.value!==""&&e.input.value!==void 0&&p(),e.close(),e.config&&e.config.mode==="range"&&e.selectedDates.length===1&&e.clear(!1))}}function de(n){if(!(!n||e.config.minDate&&ne.config.maxDate.getFullYear())){var t=n,i=e.currentYear!==t;e.currentYear=t||e.currentYear,e.config.maxDate&&e.currentYear===e.config.maxDate.getFullYear()?e.currentMonth=Math.min(e.config.maxDate.getMonth(),e.currentMonth):e.config.minDate&&e.currentYear===e.config.minDate.getFullYear()&&(e.currentMonth=Math.max(e.config.minDate.getMonth(),e.currentMonth)),i&&(e.redraw(),S("onYearChange"),X())}}function G(n,t){var i;t===void 0&&(t=!0);var o=e.parseDate(n,void 0,t);if(e.config.minDate&&o&&j(o,e.config.minDate,t!==void 0?t:!e.minDateHasTime)<0||e.config.maxDate&&o&&j(o,e.config.maxDate,t!==void 0?t:!e.maxDateHasTime)>0)return!1;if(!e.config.enable&&e.config.disable.length===0)return!0;if(o===void 0)return!1;for(var l=!!e.config.enable,s=(i=e.config.enable)!==null&&i!==void 0?i:e.config.disable,v=0,d=void 0;v=d.from.getTime()&&o.getTime()<=d.to.getTime())return l}return!l}function me(n){return e.daysContainer!==void 0?n.className.indexOf("hidden")===-1&&n.className.indexOf("flatpickr-disabled")===-1&&e.daysContainer.contains(n):!1}function hn(n){var t=n.target===e._input,i=e._input.value.trimEnd()!==Ie();t&&i&&!(n.relatedTarget&&ie(n.relatedTarget))&&e.setDate(e._input.value,!0,n.target===e.altInput?e.config.altFormat:e.config.dateFormat)}function We(n){var t=L(n),i=e.config.wrap?a.contains(t):t===e._input,o=e.config.allowInput,l=e.isOpen&&(!o||!i),s=e.config.inline&&i&&!o;if(n.keyCode===13&&i){if(o)return e.setDate(e._input.value,!0,t===e.altInput?e.config.altFormat:e.config.dateFormat),e.close(),t.blur();e.open()}else if(ie(t)||l||s){var v=!!e.timeContainer&&e.timeContainer.contains(t);switch(n.keyCode){case 13:v?(n.preventDefault(),p(),Te()):Je(n);break;case 27:n.preventDefault(),Te();break;case 8:case 46:i&&!e.config.allowInput&&(n.preventDefault(),e.clear());break;case 37:case 39:if(!v&&!i){n.preventDefault();var d=h();if(e.daysContainer!==void 0&&(o===!1||d&&me(d))){var C=n.keyCode===39?1:-1;n.ctrlKey?(n.stopPropagation(),Ee(C),re(B(1),0)):re(void 0,C)}}else e.hourElement&&e.hourElement.focus();break;case 38:case 40:n.preventDefault();var f=n.keyCode===40?1:-1;e.daysContainer&&t.$i!==void 0||t===e.input||t===e.altInput?n.ctrlKey?(n.stopPropagation(),de(e.currentYear-f),re(B(1),0)):v||re(void 0,f*7):t===e.currentYearElement?de(e.currentYear-f):e.config.enableTime&&(!v&&e.hourElement&&e.hourElement.focus(),p(n),e._debouncedChange());break;case 9:if(v){var g=[e.hourElement,e.minuteElement,e.secondElement,e.amPM].concat(e.pluginElements).filter(function(R){return R}),E=g.indexOf(t);if(E!==-1){var U=g[E+(n.shiftKey?-1:1)];n.preventDefault(),(U||e._input).focus()}}else!e.config.noCalendar&&e.daysContainer&&e.daysContainer.contains(t)&&n.shiftKey&&(n.preventDefault(),e._input.focus());break;default:break}}if(e.amPM!==void 0&&t===e.amPM)switch(n.key){case e.l10n.amPM[0].charAt(0):case e.l10n.amPM[0].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[0],_(),J();break;case e.l10n.amPM[1].charAt(0):case e.l10n.amPM[1].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[1],_(),J();break}(i||ie(t))&&S("onKeyDown",n)}function ge(n,t){if(t===void 0&&(t="flatpickr-day"),!(e.selectedDates.length!==1||n&&(!n.classList.contains(t)||n.classList.contains("flatpickr-disabled")))){for(var i=n?n.dateObj.getTime():e.days.firstElementChild.dateObj.getTime(),o=e.parseDate(e.selectedDates[0],void 0,!0).getTime(),l=Math.min(i,e.selectedDates[0].getTime()),s=Math.max(i,e.selectedDates[0].getTime()),v=!1,d=0,C=0,f=l;fl&&fd)?d=f:f>o&&(!C||f ."+t));g.forEach(function(E){var U=E.dateObj,R=U.getTime(),oe=d>0&&R0&&R>C;if(oe){E.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(ee){E.classList.remove(ee)});return}else if(v&&!oe)return;["startRange","inRange","endRange","notAllowed"].forEach(function(ee){E.classList.remove(ee)}),n!==void 0&&(n.classList.add(i<=e.selectedDates[0].getTime()?"startRange":"endRange"),oi&&R===o&&E.classList.add("endRange"),R>=d&&(C===0||R<=C)&&Ze(R,o,i)&&E.classList.add("inRange"))})}}function pn(){e.isOpen&&!e.config.static&&!e.config.inline&&he()}function vn(n,t){if(t===void 0&&(t=e._positionElement),e.isMobile===!0){if(n){n.preventDefault();var i=L(n);i&&i.blur()}e.mobileInput!==void 0&&(e.mobileInput.focus(),e.mobileInput.click()),S("onOpen");return}else if(e._input.disabled||e.config.inline)return;var o=e.isOpen;e.isOpen=!0,o||(e.calendarContainer.classList.add("open"),e._input.classList.add("active"),S("onOpen"),he(t)),e.config.enableTime===!0&&e.config.noCalendar===!0&&e.config.allowInput===!1&&(n===void 0||!e.timeContainer.contains(n.relatedTarget))&&setTimeout(function(){return e.hourElement.select()},50)}function Ke(n){return function(t){var i=e.config["_"+n+"Date"]=e.parseDate(t,e.config.dateFormat),o=e.config["_"+(n==="min"?"max":"min")+"Date"];i!==void 0&&(e[n==="min"?"minDateHasTime":"maxDateHasTime"]=i.getHours()>0||i.getMinutes()>0||i.getSeconds()>0),e.selectedDates&&(e.selectedDates=e.selectedDates.filter(function(l){return G(l)}),!e.selectedDates.length&&n==="min"&&I(i),J()),e.daysContainer&&(qe(),i!==void 0?e.currentYearElement[n]=i.getFullYear().toString():e.currentYearElement.removeAttribute(n),e.currentYearElement.disabled=!!o&&i!==void 0&&o.getFullYear()===i.getFullYear())}}function Dn(){var n=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],t=A(A({},JSON.parse(JSON.stringify(a.dataset||{}))),r),i={};e.config.parseDate=t.parseDate,e.config.formatDate=t.formatDate,Object.defineProperty(e.config,"enable",{get:function(){return e.config._enable},set:function(g){e.config._enable=$e(g)}}),Object.defineProperty(e.config,"disable",{get:function(){return e.config._disable},set:function(g){e.config._disable=$e(g)}});var o=t.mode==="time";if(!t.dateFormat&&(t.enableTime||o)){var l=T.defaultConfig.dateFormat||z.dateFormat;i.dateFormat=t.noCalendar||o?"H:i"+(t.enableSeconds?":S":""):l+" H:i"+(t.enableSeconds?":S":"")}if(t.altInput&&(t.enableTime||o)&&!t.altFormat){var s=T.defaultConfig.altFormat||z.altFormat;i.altFormat=t.noCalendar||o?"h:i"+(t.enableSeconds?":S K":" K"):s+(" h:i"+(t.enableSeconds?":S":"")+" K")}Object.defineProperty(e.config,"minDate",{get:function(){return e.config._minDate},set:Ke("min")}),Object.defineProperty(e.config,"maxDate",{get:function(){return e.config._maxDate},set:Ke("max")});var v=function(g){return function(E){e.config[g==="min"?"_minTime":"_maxTime"]=e.parseDate(E,"H:i:S")}};Object.defineProperty(e.config,"minTime",{get:function(){return e.config._minTime},set:v("min")}),Object.defineProperty(e.config,"maxTime",{get:function(){return e.config._maxTime},set:v("max")}),t.mode==="time"&&(e.config.noCalendar=!0,e.config.enableTime=!0),Object.assign(e.config,i,t);for(var d=0;d-1?e.config[f]=Me(C[f]).map(D).concat(e.config[f]):typeof t[f]>"u"&&(e.config[f]=C[f])}t.altInputClass||(e.config.altInputClass=Be().className+" "+e.config.altInputClass),S("onParseConfig")}function Be(){return e.config.wrap?a.querySelector("[data-input]"):a}function Ue(){typeof e.config.locale!="object"&&typeof T.l10ns[e.config.locale]>"u"&&e.config.errorHandler(new Error("flatpickr: invalid locale "+e.config.locale)),e.l10n=A(A({},T.l10ns.default),typeof e.config.locale=="object"?e.config.locale:e.config.locale!=="default"?T.l10ns[e.config.locale]:void 0),V.D="("+e.l10n.weekdays.shorthand.join("|")+")",V.l="("+e.l10n.weekdays.longhand.join("|")+")",V.M="("+e.l10n.months.shorthand.join("|")+")",V.F="("+e.l10n.months.longhand.join("|")+")",V.K="("+e.l10n.amPM[0]+"|"+e.l10n.amPM[1]+"|"+e.l10n.amPM[0].toLowerCase()+"|"+e.l10n.amPM[1].toLowerCase()+")";var n=A(A({},r),JSON.parse(JSON.stringify(a.dataset||{})));n.time_24hr===void 0&&T.defaultConfig.time_24hr===void 0&&(e.config.time_24hr=e.l10n.time_24hr),e.formatDate=Pe(e),e.parseDate=we({config:e.config,l10n:e.l10n})}function he(n){if(typeof e.config.position=="function")return void e.config.position(e,n);if(e.calendarContainer!==void 0){S("onPreCalendarPosition");var t=n||e._positionElement,i=Array.prototype.reduce.call(e.calendarContainer.children,function(Hn,Ln){return Hn+Ln.offsetHeight},0),o=e.calendarContainer.offsetWidth,l=e.config.position.split(" "),s=l[0],v=l.length>1?l[1]:null,d=t.getBoundingClientRect(),C=window.innerHeight-d.bottom,f=s==="above"||s!=="below"&&Ci,g=window.pageYOffset+d.top+(f?-i-2:t.offsetHeight+2);if(Y(e.calendarContainer,"arrowTop",!f),Y(e.calendarContainer,"arrowBottom",f),!e.config.inline){var E=window.pageXOffset+d.left,U=!1,R=!1;v==="center"?(E-=(o-d.width)/2,U=!0):v==="right"&&(E-=o-d.width,R=!0),Y(e.calendarContainer,"arrowLeft",!U&&!R),Y(e.calendarContainer,"arrowCenter",U),Y(e.calendarContainer,"arrowRight",R);var oe=window.document.body.offsetWidth-(window.pageXOffset+d.right),ee=E+o>window.document.body.offsetWidth,_n=oe+o>window.document.body.offsetWidth;if(Y(e.calendarContainer,"rightMost",ee),!e.config.static)if(e.calendarContainer.style.top=g+"px",!ee)e.calendarContainer.style.left=E+"px",e.calendarContainer.style.right="auto";else if(!_n)e.calendarContainer.style.left="auto",e.calendarContainer.style.right=oe+"px";else{var Oe=bn();if(Oe===void 0)return;var In=window.document.body.offsetWidth,On=Math.max(0,In/2-o/2),Yn=".flatpickr-calendar.centerMost:before",An=".flatpickr-calendar.centerMost:after",Nn=Oe.cssRules.length,Pn="{left:"+d.left+"px;right:auto;}";Y(e.calendarContainer,"rightMost",!1),Y(e.calendarContainer,"centerMost",!0),Oe.insertRule(Yn+","+An+Pn,Nn),e.calendarContainer.style.left=On+"px",e.calendarContainer.style.right="auto"}}}}function bn(){for(var n=null,t=0;te.currentMonth+e.config.showMonths-1)&&e.config.mode!=="range";if(e.selectedDateElem=o,e.config.mode==="single")e.selectedDates=[l];else if(e.config.mode==="multiple"){var v=_e(l);v?e.selectedDates.splice(parseInt(v),1):e.selectedDates.push(l)}else e.config.mode==="range"&&(e.selectedDates.length===2&&e.clear(!1,!1),e.latestSelectedDateObj=l,e.selectedDates.push(l),j(l,e.selectedDates[0],!0)!==0&&e.selectedDates.sort(function(g,E){return g.getTime()-E.getTime()}));if(_(),s){var d=e.currentYear!==l.getFullYear();e.currentYear=l.getFullYear(),e.currentMonth=l.getMonth(),d&&(S("onYearChange"),X()),S("onMonthChange")}if(ve(),fe(),J(),!s&&e.config.mode!=="range"&&e.config.showMonths===1?$(o):e.selectedDateElem!==void 0&&e.hourElement===void 0&&e.selectedDateElem&&e.selectedDateElem.focus(),e.hourElement!==void 0&&e.hourElement!==void 0&&e.hourElement.focus(),e.config.closeOnSelect){var C=e.config.mode==="single"&&!e.config.enableTime,f=e.config.mode==="range"&&e.selectedDates.length===2&&!e.config.enableTime;(C||f)&&Te()}q()}}var pe={locale:[Ue,Re],showMonths:[Le,w,je],minDate:[m],maxDate:[m],positionElement:[ze],clickOpens:[function(){e.config.clickOpens===!0?(M(e._input,"focus",e.open),M(e._input,"click",e.open)):(e._input.removeEventListener("focus",e.open),e._input.removeEventListener("click",e.open))}]};function Mn(n,t){if(n!==null&&typeof n=="object"){Object.assign(e.config,n);for(var i in n)pe[i]!==void 0&&pe[i].forEach(function(o){return o()})}else e.config[n]=t,pe[n]!==void 0?pe[n].forEach(function(o){return o()}):De.indexOf(n)>-1&&(e.config[n]=Me(t));e.redraw(),J(!0)}function Ve(n,t){var i=[];if(n instanceof Array)i=n.map(function(o){return e.parseDate(o,t)});else if(n instanceof Date||typeof n=="number")i=[e.parseDate(n,t)];else if(typeof n=="string")switch(e.config.mode){case"single":case"time":i=[e.parseDate(n,t)];break;case"multiple":i=n.split(e.config.conjunction).map(function(o){return e.parseDate(o,t)});break;case"range":i=n.split(e.l10n.rangeSeparator).map(function(o){return e.parseDate(o,t)});break;default:break}else e.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(n)));e.selectedDates=e.config.allowInvalidPreload?i:i.filter(function(o){return o instanceof Date&&G(o,!1)}),e.config.mode==="range"&&e.selectedDates.sort(function(o,l){return o.getTime()-l.getTime()})}function wn(n,t,i){if(t===void 0&&(t=!1),i===void 0&&(i=e.config.dateFormat),n!==0&&!n||n instanceof Array&&n.length===0)return e.clear(t);Ve(n,i),e.latestSelectedDateObj=e.selectedDates[e.selectedDates.length-1],e.redraw(),m(void 0,t),I(),e.selectedDates.length===0&&e.clear(!1),J(t),t&&S("onChange")}function $e(n){return n.slice().map(function(t){return typeof t=="string"||typeof t=="number"||t instanceof Date?e.parseDate(t,void 0,!0):t&&typeof t=="object"&&t.from&&t.to?{from:e.parseDate(t.from,void 0),to:e.parseDate(t.to,void 0)}:t}).filter(function(t){return t})}function yn(){e.selectedDates=[],e.now=e.parseDate(e.config.now)||new Date;var n=e.config.defaultDate||((e.input.nodeName==="INPUT"||e.input.nodeName==="TEXTAREA")&&e.input.placeholder&&e.input.value===e.input.placeholder?null:e.input.value);n&&Ve(n,e.config.dateFormat),e._initialDate=e.selectedDates.length>0?e.selectedDates[0]:e.config.minDate&&e.config.minDate.getTime()>e.now.getTime()?e.config.minDate:e.config.maxDate&&e.config.maxDate.getTime()0&&(e.latestSelectedDateObj=e.selectedDates[0]),e.config.minTime!==void 0&&(e.config.minTime=e.parseDate(e.config.minTime,"H:i")),e.config.maxTime!==void 0&&(e.config.maxTime=e.parseDate(e.config.maxTime,"H:i")),e.minDateHasTime=!!e.config.minDate&&(e.config.minDate.getHours()>0||e.config.minDate.getMinutes()>0||e.config.minDate.getSeconds()>0),e.maxDateHasTime=!!e.config.maxDate&&(e.config.maxDate.getHours()>0||e.config.maxDate.getMinutes()>0||e.config.maxDate.getSeconds()>0)}function xn(){if(e.input=Be(),!e.input){e.config.errorHandler(new Error("Invalid input element specified"));return}e.input._type=e.input.type,e.input.type="text",e.input.classList.add("flatpickr-input"),e._input=e.input,e.config.altInput&&(e.altInput=y(e.input.nodeName,e.config.altInputClass),e._input=e.altInput,e.altInput.placeholder=e.input.placeholder,e.altInput.disabled=e.input.disabled,e.altInput.required=e.input.required,e.altInput.tabIndex=e.input.tabIndex,e.altInput.type="text",e.input.setAttribute("type","hidden"),!e.config.static&&e.input.parentNode&&e.input.parentNode.insertBefore(e.altInput,e.input.nextSibling)),e.config.allowInput||e._input.setAttribute("readonly","readonly"),ze()}function ze(){e._positionElement=e.config.positionElement||e._input}function kn(){var n=e.config.enableTime?e.config.noCalendar?"time":"datetime-local":"date";e.mobileInput=y("input",e.input.className+" flatpickr-mobile"),e.mobileInput.tabIndex=1,e.mobileInput.type=n,e.mobileInput.disabled=e.input.disabled,e.mobileInput.required=e.input.required,e.mobileInput.placeholder=e.input.placeholder,e.mobileFormatStr=n==="datetime-local"?"Y-m-d\\TH:i:S":n==="date"?"Y-m-d":"H:i:S",e.selectedDates.length>0&&(e.mobileInput.defaultValue=e.mobileInput.value=e.formatDate(e.selectedDates[0],e.mobileFormatStr)),e.config.minDate&&(e.mobileInput.min=e.formatDate(e.config.minDate,"Y-m-d")),e.config.maxDate&&(e.mobileInput.max=e.formatDate(e.config.maxDate,"Y-m-d")),e.input.getAttribute("step")&&(e.mobileInput.step=String(e.input.getAttribute("step"))),e.input.type="hidden",e.altInput!==void 0&&(e.altInput.type="hidden");try{e.input.parentNode&&e.input.parentNode.insertBefore(e.mobileInput,e.input.nextSibling)}catch{}M(e.mobileInput,"change",function(t){e.setDate(L(t).value,!1,e.mobileFormatStr),S("onChange"),S("onClose")})}function En(n){if(e.isOpen===!0)return e.close();e.open(n)}function S(n,t){if(e.config!==void 0){var i=e.config[n];if(i!==void 0&&i.length>0)for(var o=0;i[o]&&o=0&&j(n,e.selectedDates[1])<=0}function ve(){e.config.noCalendar||e.isMobile||!e.monthNav||(e.yearElements.forEach(function(n,t){var i=new Date(e.currentYear,e.currentMonth,1);i.setMonth(e.currentMonth+t),e.config.showMonths>1||e.config.monthSelectorType==="static"?e.monthElements[t].textContent=ue(i.getMonth(),e.config.shorthandCurrentMonth,e.l10n)+" ":e.monthsDropdownContainer.value=i.getMonth().toString(),n.value=i.getFullYear().toString()}),e._hidePrevMonthArrow=e.config.minDate!==void 0&&(e.currentYear===e.config.minDate.getFullYear()?e.currentMonth<=e.config.minDate.getMonth():e.currentYeare.config.maxDate.getMonth():e.currentYear>e.config.maxDate.getFullYear()))}function Ie(n){var t=n||(e.config.altInput?e.config.altFormat:e.config.dateFormat);return e.selectedDates.map(function(i){return e.formatDate(i,t)}).filter(function(i,o,l){return e.config.mode!=="range"||e.config.enableTime||l.indexOf(i)===o}).join(e.config.mode!=="range"?e.config.conjunction:e.l10n.rangeSeparator)}function J(n){n===void 0&&(n=!0),e.mobileInput!==void 0&&e.mobileFormatStr&&(e.mobileInput.value=e.latestSelectedDateObj!==void 0?e.formatDate(e.latestSelectedDateObj,e.mobileFormatStr):""),e.input.value=Ie(e.config.dateFormat),e.altInput!==void 0&&(e.altInput.value=Ie(e.config.altFormat)),n!==!1&&S("onValueUpdate")}function Tn(n){var t=L(n),i=e.prevMonthNav.contains(t),o=e.nextMonthNav.contains(t);i||o?Ee(i?-1:1):e.yearElements.indexOf(t)>=0?t.select():t.classList.contains("arrowUp")?e.changeYear(e.currentYear+1):t.classList.contains("arrowDown")&&e.changeYear(e.currentYear-1)}function Fn(n){n.preventDefault();var t=n.type==="keydown",i=L(n),o=i;e.amPM!==void 0&&i===e.amPM&&(e.amPM.textContent=e.l10n.amPM[H(e.amPM.textContent===e.l10n.amPM[0])]);var l=parseFloat(o.getAttribute("min")),s=parseFloat(o.getAttribute("max")),v=parseFloat(o.getAttribute("step")),d=parseInt(o.value,10),C=n.delta||(t?n.which===38?1:-1:0),f=d+v*C;if(typeof o.value<"u"&&o.value.length===2){var g=o===e.hourElement,E=o===e.minuteElement;fs&&(f=o===e.hourElement?f-s-H(!e.amPM):l,E&&x(void 0,1,e.hourElement)),e.amPM&&g&&(v===1?f+d===23:Math.abs(f-d)>v)&&(e.amPM.textContent=e.l10n.amPM[H(e.amPM.textContent===e.l10n.amPM[0])]),o.value=O(f)}}return u(),e}function te(a,r){for(var e=Array.prototype.slice.call(a).filter(function(D){return D instanceof HTMLElement}),c=[],u=0;u ",confirmText:"OK ",showAlways:!1,theme:"light"};function Kn(a){var r=ce(ce({},Wn),a),e,c="flatpickr-confirm";return function(u){return u.config.noCalendar||u.isMobile?{}:ce({onKeyDown:function(h,D,w,p){var F=Z(p),k=!u.config.time_24hr&&F===u.amPM||u.config.time_24hr&&(u.config.enableSeconds&&F===u.secondElement||!u.config.enableSeconds&&F===u.minuteElement);u.config.enableTime&&p.key==="Tab"&&k?(p.preventDefault(),e.focus()):p.key==="Enter"&&F===e&&u.close()},onReady:function(){e=u._createElement("div",c+" "+(r.showAlways?"visible":"")+" "+r.theme+"Theme",r.confirmText),e.tabIndex=-1,e.innerHTML+=r.confirmIcon,e.addEventListener("click",u.close),u.calendarContainer.appendChild(e),u.loadedPlugins.push("confirmDate")}},r.showAlways?{}:{onChange:function(h,D){var w=u.config.enableTime||u.config.mode==="multiple"||u.loadedPlugins.indexOf("monthSelect")!==-1,p=u.calendarContainer.querySelector("."+c);if(p){if(D&&!u.config.inline&&w&&p)return p.classList.add("visible");p.classList.remove("visible")}}})}}var tn=Kn;var an=function(a,r,e){return e.months[r?"shorthand":"longhand"][a]};var ke=function(){return ke=Object.assign||function(a){for(var r,e=1,c=arguments.length;ee.config.maxDate&&(m=e.config.maxDate),e.currentYear=m.getFullYear()),e.currentYearElement.value=String(e.currentYear),e.rContainer){var b=e.rContainer.querySelectorAll(".flatpickr-monthSelect-month");b.forEach(function(x){x.dateObj.setFullYear(e.currentYear),e.config.minDate&&x.dateObje.config.maxDate?x.classList.add("flatpickr-disabled"):x.classList.remove("flatpickr-disabled")})}p()}function k(m){m.preventDefault(),m.stopPropagation();var b=Z(m);if(b instanceof Element&&!b.classList.contains("flatpickr-disabled")&&!b.classList.contains("notAllowed")&&(_(b.dateObj),e.config.closeOnSelect)){var x=e.config.mode==="single",N=e.config.mode==="range"&&e.selectedDates.length===2;(x||N)&&e.close()}}function _(m){var b=new Date(e.currentYear,m.getMonth(),m.getDate()),x=[];switch(e.config.mode){case"single":x=[b];break;case"multiple":x.push(b);break;case"range":e.selectedDates.length===2?x=[b]:(x=e.selectedDates.concat([b]),x.sort(function(N,W){return N.getTime()-W.getTime()}));break}e.setDate(x,!0),p()}var I={37:-1,39:1,40:3,38:-3};function P(m,b,x,N){var W=I[N.keyCode]!==void 0;if(!(!W&&N.keyCode!==13)&&!(!e.rContainer||!c.monthsContainer)){var $=e.rContainer.querySelector(".flatpickr-monthSelect-month.selected"),B=Array.prototype.indexOf.call(c.monthsContainer.children,document.activeElement);if(B===-1){var Q=$||c.monthsContainer.firstElementChild;Q.focus(),B=Q.$i}W?c.monthsContainer.children[(12+B+I[N.keyCode])%12].focus():N.keyCode===13&&c.monthsContainer.contains(document.activeElement)&&_(document.activeElement.dateObj)}}function K(){var m;((m=e.config)===null||m===void 0?void 0:m.mode)==="range"&&e.selectedDates.length===1&&e.clear(!1),e.selectedDates.length||D()}function M(){r._stubbedCurrentMonth=e._initialDate.getMonth(),e._initialDate.setMonth(r._stubbedCurrentMonth),e.currentMonth=r._stubbedCurrentMonth}function q(){r._stubbedCurrentMonth&&(e._initialDate.setMonth(r._stubbedCurrentMonth),e.currentMonth=r._stubbedCurrentMonth,delete r._stubbedCurrentMonth)}function ae(){if(c.monthsContainer!==null)for(var m=c.monthsContainer.querySelectorAll(".flatpickr-monthSelect-month"),b=0;bI||M<_?K.classList.remove("inRange"):K.classList.add("inRange")}}function e(){var D=a.latestSelectedDateObj;D!==void 0&&D.getMonth()===a.currentMonth&&D.getFullYear()===a.currentYear&&(a.weekStartDay=a.days.childNodes[7*Math.floor(a.selectedDateElem.$i/7)].dateObj,a.weekEndDay=a.days.childNodes[7*Math.ceil(a.selectedDateElem.$i/7+.01)-1].dateObj);for(var w=a.days.childNodes,p=w.length;p--;){var F=w[p].dateObj;F>=a.weekStartDay&&F<=a.weekEndDay&&w[p].classList.add("week","selected")}}function c(){for(var D=a.days.childNodes,w=D.length;w--;)D[w].classList.remove("inRange")}function u(){a.daysContainer!==void 0&&a.daysContainer.addEventListener("mouseover",r)}function h(){a.daysContainer!==void 0&&a.daysContainer.removeEventListener("mouseover",r)}return{onValueUpdate:e,onMonthChange:e,onYearChange:e,onOpen:e,onClose:c,onParseConfig:function(){a.config.mode="single",a.config.enableTime=!1,a.config.dateFormat=a.config.dateFormat?a.config.dateFormat:"\\W\\e\\e\\k #W, Y",a.config.altFormat=a.config.altFormat?a.config.altFormat:"\\W\\e\\e\\k #W, Y"},onReady:[u,e,function(){a.loadedPlugins.push("weekSelect")}],onDestroy:h}}}var on=qn;function Jn(a){return{state:a.state,mode:"light",attribs:a.attribs??{},packageConfig:a.packageConfig??{},fp:null,get darkStatus(){return window.matchMedia("(prefers-color-scheme: dark)").matches},get getMode(){return localStorage.getItem("theme")?localStorage.getItem("theme"):(this.mode=this.darkStatus?"dark":"light",this.mode)},get darkLightAssetUrl(){return this.darkStatus?this.attribs.darkThemeAsset:this.attribs.lightThemeAsset},init:function(){this.mode=this.darkStatus?"dark":"light";let r={mode:this.attribs.mode,time_24hr:!0,altFormat:"F j, Y",disableMobile:!0,initialDate:this.state,allowInvalidPreload:!1,static:!1,defaultDate:this.state,...this.packageConfig,plugins:[new tn({confirmText:"OK",showAlways:!1,theme:this.mode})]};if(this.getMode==="dark"){let e=document.querySelector("#pickr-theme");console.log(e),e&&(e.href=this.attribs.darkThemeAsset)}this.attribs.monthSelect?r.plugins.push(new rn({shorthand:!1,dateFormat:"F Y",altInput:!0,altFormat:"F, Y",theme:this.mode})):this.attribs.weekSelect&&r.plugins.push(new on({})),this.fp=nn(this.$refs.picker,r),this.fp.parseDate(this.state,this.packageConfig.dateFormat),window.addEventListener("theme-changed",e=>{this.mode=e.detail;let c;this.mode==="dark"?c=this.attribs.darkThemeAsset:c=this.attribs.themeAsset,document.querySelector("#pickr-theme").href=c})}}}export{Jn as default};
+ `}}function fn(){e.calendarContainer.classList.add("hasWeeks");var n=y("div","flatpickr-weekwrapper");n.appendChild(y("span","flatpickr-weekday",e.l10n.weekAbbreviation));var t=y("div","flatpickr-weeks");return n.appendChild(t),{weekWrapper:n,weekNumbers:t}}function Ee(n,t){t===void 0&&(t=!0);var i=t?n:n-e.currentMonth;i<0&&e._hidePrevMonthArrow===!0||i>0&&e._hideNextMonthArrow===!0||(e.currentMonth+=i,(e.currentMonth<0||e.currentMonth>11)&&(e.currentYear+=e.currentMonth>11?1:-1,e.currentMonth=(e.currentMonth+12)%12,S("onYearChange"),X()),fe(),S("onMonthChange"),ve())}function dn(n,t){if(n===void 0&&(n=!0),t===void 0&&(t=!0),e.input.value="",e.altInput!==void 0&&(e.altInput.value=""),e.mobileInput!==void 0&&(e.mobileInput.value=""),e.selectedDates=[],e.latestSelectedDateObj=void 0,t===!0&&(e.currentYear=e._initialDate.getFullYear(),e.currentMonth=e._initialDate.getMonth()),e.config.enableTime===!0){var i=xe(e.config),o=i.hours,l=i.minutes,s=i.seconds;P(o,l,s)}e.redraw(),n&&S("onChange")}function mn(){e.isOpen=!1,e.isMobile||(e.calendarContainer!==void 0&&e.calendarContainer.classList.remove("open"),e._input!==void 0&&e._input.classList.remove("active")),S("onClose")}function gn(){e.config!==void 0&&S("onDestroy");for(var n=e._handlers.length;n--;)e._handlers[n].remove();if(e._handlers=[],e.mobileInput)e.mobileInput.parentNode&&e.mobileInput.parentNode.removeChild(e.mobileInput),e.mobileInput=void 0;else if(e.calendarContainer&&e.calendarContainer.parentNode)if(e.config.static&&e.calendarContainer.parentNode){var t=e.calendarContainer.parentNode;if(t.lastChild&&t.removeChild(t.lastChild),t.parentNode){for(;t.firstChild;)t.parentNode.insertBefore(t.firstChild,t);t.parentNode.removeChild(t)}}else e.calendarContainer.parentNode.removeChild(e.calendarContainer);e.altInput&&(e.input.type="text",e.altInput.parentNode&&e.altInput.parentNode.removeChild(e.altInput),delete e.altInput),e.input&&(e.input.type=e.input._type,e.input.classList.remove("flatpickr-input"),e.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(i){try{delete e[i]}catch{}})}function ie(n){return e.calendarContainer.contains(n)}function Se(n){if(e.isOpen&&!e.config.inline){var t=L(n),i=ie(t),o=t===e.input||t===e.altInput||e.element.contains(t)||n.path&&n.path.indexOf&&(~n.path.indexOf(e.input)||~n.path.indexOf(e.altInput)),l=!o&&!i&&!ie(n.relatedTarget),s=!e.config.ignoredFocusElements.some(function(v){return v.contains(t)});l&&s&&(e.config.allowInput&&e.setDate(e._input.value,!1,e.config.altInput?e.config.altFormat:e.config.dateFormat),e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0&&e.input.value!==""&&e.input.value!==void 0&&p(),e.close(),e.config&&e.config.mode==="range"&&e.selectedDates.length===1&&e.clear(!1))}}function de(n){if(!(!n||e.config.minDate&&ne.config.maxDate.getFullYear())){var t=n,i=e.currentYear!==t;e.currentYear=t||e.currentYear,e.config.maxDate&&e.currentYear===e.config.maxDate.getFullYear()?e.currentMonth=Math.min(e.config.maxDate.getMonth(),e.currentMonth):e.config.minDate&&e.currentYear===e.config.minDate.getFullYear()&&(e.currentMonth=Math.max(e.config.minDate.getMonth(),e.currentMonth)),i&&(e.redraw(),S("onYearChange"),X())}}function G(n,t){var i;t===void 0&&(t=!0);var o=e.parseDate(n,void 0,t);if(e.config.minDate&&o&&j(o,e.config.minDate,t!==void 0?t:!e.minDateHasTime)<0||e.config.maxDate&&o&&j(o,e.config.maxDate,t!==void 0?t:!e.maxDateHasTime)>0)return!1;if(!e.config.enable&&e.config.disable.length===0)return!0;if(o===void 0)return!1;for(var l=!!e.config.enable,s=(i=e.config.enable)!==null&&i!==void 0?i:e.config.disable,v=0,d=void 0;v=d.from.getTime()&&o.getTime()<=d.to.getTime())return l}return!l}function me(n){return e.daysContainer!==void 0?n.className.indexOf("hidden")===-1&&n.className.indexOf("flatpickr-disabled")===-1&&e.daysContainer.contains(n):!1}function hn(n){var t=n.target===e._input,i=e._input.value.trimEnd()!==Ie();t&&i&&!(n.relatedTarget&&ie(n.relatedTarget))&&e.setDate(e._input.value,!0,n.target===e.altInput?e.config.altFormat:e.config.dateFormat)}function We(n){var t=L(n),i=e.config.wrap?a.contains(t):t===e._input,o=e.config.allowInput,l=e.isOpen&&(!o||!i),s=e.config.inline&&i&&!o;if(n.keyCode===13&&i){if(o)return e.setDate(e._input.value,!0,t===e.altInput?e.config.altFormat:e.config.dateFormat),e.close(),t.blur();e.open()}else if(ie(t)||l||s){var v=!!e.timeContainer&&e.timeContainer.contains(t);switch(n.keyCode){case 13:v?(n.preventDefault(),p(),Te()):Je(n);break;case 27:n.preventDefault(),Te();break;case 8:case 46:i&&!e.config.allowInput&&(n.preventDefault(),e.clear());break;case 37:case 39:if(!v&&!i){n.preventDefault();var d=h();if(e.daysContainer!==void 0&&(o===!1||d&&me(d))){var C=n.keyCode===39?1:-1;n.ctrlKey?(n.stopPropagation(),Ee(C),re(B(1),0)):re(void 0,C)}}else e.hourElement&&e.hourElement.focus();break;case 38:case 40:n.preventDefault();var f=n.keyCode===40?1:-1;e.daysContainer&&t.$i!==void 0||t===e.input||t===e.altInput?n.ctrlKey?(n.stopPropagation(),de(e.currentYear-f),re(B(1),0)):v||re(void 0,f*7):t===e.currentYearElement?de(e.currentYear-f):e.config.enableTime&&(!v&&e.hourElement&&e.hourElement.focus(),p(n),e._debouncedChange());break;case 9:if(v){var g=[e.hourElement,e.minuteElement,e.secondElement,e.amPM].concat(e.pluginElements).filter(function(R){return R}),E=g.indexOf(t);if(E!==-1){var U=g[E+(n.shiftKey?-1:1)];n.preventDefault(),(U||e._input).focus()}}else!e.config.noCalendar&&e.daysContainer&&e.daysContainer.contains(t)&&n.shiftKey&&(n.preventDefault(),e._input.focus());break;default:break}}if(e.amPM!==void 0&&t===e.amPM)switch(n.key){case e.l10n.amPM[0].charAt(0):case e.l10n.amPM[0].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[0],_(),J();break;case e.l10n.amPM[1].charAt(0):case e.l10n.amPM[1].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[1],_(),J();break}(i||ie(t))&&S("onKeyDown",n)}function ge(n,t){if(t===void 0&&(t="flatpickr-day"),!(e.selectedDates.length!==1||n&&(!n.classList.contains(t)||n.classList.contains("flatpickr-disabled")))){for(var i=n?n.dateObj.getTime():e.days.firstElementChild.dateObj.getTime(),o=e.parseDate(e.selectedDates[0],void 0,!0).getTime(),l=Math.min(i,e.selectedDates[0].getTime()),s=Math.max(i,e.selectedDates[0].getTime()),v=!1,d=0,C=0,f=l;fl&&fd)?d=f:f>o&&(!C||f ."+t));g.forEach(function(E){var U=E.dateObj,R=U.getTime(),oe=d>0&&R0&&R>C;if(oe){E.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(ee){E.classList.remove(ee)});return}else if(v&&!oe)return;["startRange","inRange","endRange","notAllowed"].forEach(function(ee){E.classList.remove(ee)}),n!==void 0&&(n.classList.add(i<=e.selectedDates[0].getTime()?"startRange":"endRange"),oi&&R===o&&E.classList.add("endRange"),R>=d&&(C===0||R<=C)&&Ze(R,o,i)&&E.classList.add("inRange"))})}}function pn(){e.isOpen&&!e.config.static&&!e.config.inline&&he()}function vn(n,t){if(t===void 0&&(t=e._positionElement),e.isMobile===!0){if(n){n.preventDefault();var i=L(n);i&&i.blur()}e.mobileInput!==void 0&&(e.mobileInput.focus(),e.mobileInput.click()),S("onOpen");return}else if(e._input.disabled||e.config.inline)return;var o=e.isOpen;e.isOpen=!0,o||(e.calendarContainer.classList.add("open"),e._input.classList.add("active"),S("onOpen"),he(t)),e.config.enableTime===!0&&e.config.noCalendar===!0&&e.config.allowInput===!1&&(n===void 0||!e.timeContainer.contains(n.relatedTarget))&&setTimeout(function(){return e.hourElement.select()},50)}function Ke(n){return function(t){var i=e.config["_"+n+"Date"]=e.parseDate(t,e.config.dateFormat),o=e.config["_"+(n==="min"?"max":"min")+"Date"];i!==void 0&&(e[n==="min"?"minDateHasTime":"maxDateHasTime"]=i.getHours()>0||i.getMinutes()>0||i.getSeconds()>0),e.selectedDates&&(e.selectedDates=e.selectedDates.filter(function(l){return G(l)}),!e.selectedDates.length&&n==="min"&&I(i),J()),e.daysContainer&&(qe(),i!==void 0?e.currentYearElement[n]=i.getFullYear().toString():e.currentYearElement.removeAttribute(n),e.currentYearElement.disabled=!!o&&i!==void 0&&o.getFullYear()===i.getFullYear())}}function Dn(){var n=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],t=A(A({},JSON.parse(JSON.stringify(a.dataset||{}))),r),i={};e.config.parseDate=t.parseDate,e.config.formatDate=t.formatDate,Object.defineProperty(e.config,"enable",{get:function(){return e.config._enable},set:function(g){e.config._enable=$e(g)}}),Object.defineProperty(e.config,"disable",{get:function(){return e.config._disable},set:function(g){e.config._disable=$e(g)}});var o=t.mode==="time";if(!t.dateFormat&&(t.enableTime||o)){var l=T.defaultConfig.dateFormat||z.dateFormat;i.dateFormat=t.noCalendar||o?"H:i"+(t.enableSeconds?":S":""):l+" H:i"+(t.enableSeconds?":S":"")}if(t.altInput&&(t.enableTime||o)&&!t.altFormat){var s=T.defaultConfig.altFormat||z.altFormat;i.altFormat=t.noCalendar||o?"h:i"+(t.enableSeconds?":S K":" K"):s+(" h:i"+(t.enableSeconds?":S":"")+" K")}Object.defineProperty(e.config,"minDate",{get:function(){return e.config._minDate},set:Ke("min")}),Object.defineProperty(e.config,"maxDate",{get:function(){return e.config._maxDate},set:Ke("max")});var v=function(g){return function(E){e.config[g==="min"?"_minTime":"_maxTime"]=e.parseDate(E,"H:i:S")}};Object.defineProperty(e.config,"minTime",{get:function(){return e.config._minTime},set:v("min")}),Object.defineProperty(e.config,"maxTime",{get:function(){return e.config._maxTime},set:v("max")}),t.mode==="time"&&(e.config.noCalendar=!0,e.config.enableTime=!0),Object.assign(e.config,i,t);for(var d=0;d-1?e.config[f]=Me(C[f]).map(D).concat(e.config[f]):typeof t[f]>"u"&&(e.config[f]=C[f])}t.altInputClass||(e.config.altInputClass=Be().className+" "+e.config.altInputClass),S("onParseConfig")}function Be(){return e.config.wrap?a.querySelector("[data-input]"):a}function Ue(){typeof e.config.locale!="object"&&typeof T.l10ns[e.config.locale]>"u"&&e.config.errorHandler(new Error("flatpickr: invalid locale "+e.config.locale)),e.l10n=A(A({},T.l10ns.default),typeof e.config.locale=="object"?e.config.locale:e.config.locale!=="default"?T.l10ns[e.config.locale]:void 0),V.D="("+e.l10n.weekdays.shorthand.join("|")+")",V.l="("+e.l10n.weekdays.longhand.join("|")+")",V.M="("+e.l10n.months.shorthand.join("|")+")",V.F="("+e.l10n.months.longhand.join("|")+")",V.K="("+e.l10n.amPM[0]+"|"+e.l10n.amPM[1]+"|"+e.l10n.amPM[0].toLowerCase()+"|"+e.l10n.amPM[1].toLowerCase()+")";var n=A(A({},r),JSON.parse(JSON.stringify(a.dataset||{})));n.time_24hr===void 0&&T.defaultConfig.time_24hr===void 0&&(e.config.time_24hr=e.l10n.time_24hr),e.formatDate=Pe(e),e.parseDate=we({config:e.config,l10n:e.l10n})}function he(n){if(typeof e.config.position=="function")return void e.config.position(e,n);if(e.calendarContainer!==void 0){S("onPreCalendarPosition");var t=n||e._positionElement,i=Array.prototype.reduce.call(e.calendarContainer.children,function(Hn,Ln){return Hn+Ln.offsetHeight},0),o=e.calendarContainer.offsetWidth,l=e.config.position.split(" "),s=l[0],v=l.length>1?l[1]:null,d=t.getBoundingClientRect(),C=window.innerHeight-d.bottom,f=s==="above"||s!=="below"&&Ci,g=window.pageYOffset+d.top+(f?-i-2:t.offsetHeight+2);if(Y(e.calendarContainer,"arrowTop",!f),Y(e.calendarContainer,"arrowBottom",f),!e.config.inline){var E=window.pageXOffset+d.left,U=!1,R=!1;v==="center"?(E-=(o-d.width)/2,U=!0):v==="right"&&(E-=o-d.width,R=!0),Y(e.calendarContainer,"arrowLeft",!U&&!R),Y(e.calendarContainer,"arrowCenter",U),Y(e.calendarContainer,"arrowRight",R);var oe=window.document.body.offsetWidth-(window.pageXOffset+d.right),ee=E+o>window.document.body.offsetWidth,_n=oe+o>window.document.body.offsetWidth;if(Y(e.calendarContainer,"rightMost",ee),!e.config.static)if(e.calendarContainer.style.top=g+"px",!ee)e.calendarContainer.style.left=E+"px",e.calendarContainer.style.right="auto";else if(!_n)e.calendarContainer.style.left="auto",e.calendarContainer.style.right=oe+"px";else{var Oe=bn();if(Oe===void 0)return;var In=window.document.body.offsetWidth,On=Math.max(0,In/2-o/2),Yn=".flatpickr-calendar.centerMost:before",An=".flatpickr-calendar.centerMost:after",Nn=Oe.cssRules.length,Pn="{left:"+d.left+"px;right:auto;}";Y(e.calendarContainer,"rightMost",!1),Y(e.calendarContainer,"centerMost",!0),Oe.insertRule(Yn+","+An+Pn,Nn),e.calendarContainer.style.left=On+"px",e.calendarContainer.style.right="auto"}}}}function bn(){for(var n=null,t=0;te.currentMonth+e.config.showMonths-1)&&e.config.mode!=="range";if(e.selectedDateElem=o,e.config.mode==="single")e.selectedDates=[l];else if(e.config.mode==="multiple"){var v=_e(l);v?e.selectedDates.splice(parseInt(v),1):e.selectedDates.push(l)}else e.config.mode==="range"&&(e.selectedDates.length===2&&e.clear(!1,!1),e.latestSelectedDateObj=l,e.selectedDates.push(l),j(l,e.selectedDates[0],!0)!==0&&e.selectedDates.sort(function(g,E){return g.getTime()-E.getTime()}));if(_(),s){var d=e.currentYear!==l.getFullYear();e.currentYear=l.getFullYear(),e.currentMonth=l.getMonth(),d&&(S("onYearChange"),X()),S("onMonthChange")}if(ve(),fe(),J(),!s&&e.config.mode!=="range"&&e.config.showMonths===1?$(o):e.selectedDateElem!==void 0&&e.hourElement===void 0&&e.selectedDateElem&&e.selectedDateElem.focus(),e.hourElement!==void 0&&e.hourElement!==void 0&&e.hourElement.focus(),e.config.closeOnSelect){var C=e.config.mode==="single"&&!e.config.enableTime,f=e.config.mode==="range"&&e.selectedDates.length===2&&!e.config.enableTime;(C||f)&&Te()}q()}}var pe={locale:[Ue,Re],showMonths:[Le,w,je],minDate:[m],maxDate:[m],positionElement:[ze],clickOpens:[function(){e.config.clickOpens===!0?(M(e._input,"focus",e.open),M(e._input,"click",e.open)):(e._input.removeEventListener("focus",e.open),e._input.removeEventListener("click",e.open))}]};function Mn(n,t){if(n!==null&&typeof n=="object"){Object.assign(e.config,n);for(var i in n)pe[i]!==void 0&&pe[i].forEach(function(o){return o()})}else e.config[n]=t,pe[n]!==void 0?pe[n].forEach(function(o){return o()}):De.indexOf(n)>-1&&(e.config[n]=Me(t));e.redraw(),J(!0)}function Ve(n,t){var i=[];if(n instanceof Array)i=n.map(function(o){return e.parseDate(o,t)});else if(n instanceof Date||typeof n=="number")i=[e.parseDate(n,t)];else if(typeof n=="string")switch(e.config.mode){case"single":case"time":i=[e.parseDate(n,t)];break;case"multiple":i=n.split(e.config.conjunction).map(function(o){return e.parseDate(o,t)});break;case"range":i=n.split(e.l10n.rangeSeparator).map(function(o){return e.parseDate(o,t)});break;default:break}else e.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(n)));e.selectedDates=e.config.allowInvalidPreload?i:i.filter(function(o){return o instanceof Date&&G(o,!1)}),e.config.mode==="range"&&e.selectedDates.sort(function(o,l){return o.getTime()-l.getTime()})}function wn(n,t,i){if(t===void 0&&(t=!1),i===void 0&&(i=e.config.dateFormat),n!==0&&!n||n instanceof Array&&n.length===0)return e.clear(t);Ve(n,i),e.latestSelectedDateObj=e.selectedDates[e.selectedDates.length-1],e.redraw(),m(void 0,t),I(),e.selectedDates.length===0&&e.clear(!1),J(t),t&&S("onChange")}function $e(n){return n.slice().map(function(t){return typeof t=="string"||typeof t=="number"||t instanceof Date?e.parseDate(t,void 0,!0):t&&typeof t=="object"&&t.from&&t.to?{from:e.parseDate(t.from,void 0),to:e.parseDate(t.to,void 0)}:t}).filter(function(t){return t})}function yn(){e.selectedDates=[],e.now=e.parseDate(e.config.now)||new Date;var n=e.config.defaultDate||((e.input.nodeName==="INPUT"||e.input.nodeName==="TEXTAREA")&&e.input.placeholder&&e.input.value===e.input.placeholder?null:e.input.value);n&&Ve(n,e.config.dateFormat),e._initialDate=e.selectedDates.length>0?e.selectedDates[0]:e.config.minDate&&e.config.minDate.getTime()>e.now.getTime()?e.config.minDate:e.config.maxDate&&e.config.maxDate.getTime()0&&(e.latestSelectedDateObj=e.selectedDates[0]),e.config.minTime!==void 0&&(e.config.minTime=e.parseDate(e.config.minTime,"H:i")),e.config.maxTime!==void 0&&(e.config.maxTime=e.parseDate(e.config.maxTime,"H:i")),e.minDateHasTime=!!e.config.minDate&&(e.config.minDate.getHours()>0||e.config.minDate.getMinutes()>0||e.config.minDate.getSeconds()>0),e.maxDateHasTime=!!e.config.maxDate&&(e.config.maxDate.getHours()>0||e.config.maxDate.getMinutes()>0||e.config.maxDate.getSeconds()>0)}function xn(){if(e.input=Be(),!e.input){e.config.errorHandler(new Error("Invalid input element specified"));return}e.input._type=e.input.type,e.input.type="text",e.input.classList.add("flatpickr-input"),e._input=e.input,e.config.altInput&&(e.altInput=y(e.input.nodeName,e.config.altInputClass),e._input=e.altInput,e.altInput.placeholder=e.input.placeholder,e.altInput.disabled=e.input.disabled,e.altInput.required=e.input.required,e.altInput.tabIndex=e.input.tabIndex,e.altInput.type="text",e.input.setAttribute("type","hidden"),!e.config.static&&e.input.parentNode&&e.input.parentNode.insertBefore(e.altInput,e.input.nextSibling)),e.config.allowInput||e._input.setAttribute("readonly","readonly"),ze()}function ze(){e._positionElement=e.config.positionElement||e._input}function kn(){var n=e.config.enableTime?e.config.noCalendar?"time":"datetime-local":"date";e.mobileInput=y("input",e.input.className+" flatpickr-mobile"),e.mobileInput.tabIndex=1,e.mobileInput.type=n,e.mobileInput.disabled=e.input.disabled,e.mobileInput.required=e.input.required,e.mobileInput.placeholder=e.input.placeholder,e.mobileFormatStr=n==="datetime-local"?"Y-m-d\\TH:i:S":n==="date"?"Y-m-d":"H:i:S",e.selectedDates.length>0&&(e.mobileInput.defaultValue=e.mobileInput.value=e.formatDate(e.selectedDates[0],e.mobileFormatStr)),e.config.minDate&&(e.mobileInput.min=e.formatDate(e.config.minDate,"Y-m-d")),e.config.maxDate&&(e.mobileInput.max=e.formatDate(e.config.maxDate,"Y-m-d")),e.input.getAttribute("step")&&(e.mobileInput.step=String(e.input.getAttribute("step"))),e.input.type="hidden",e.altInput!==void 0&&(e.altInput.type="hidden");try{e.input.parentNode&&e.input.parentNode.insertBefore(e.mobileInput,e.input.nextSibling)}catch{}M(e.mobileInput,"change",function(t){e.setDate(L(t).value,!1,e.mobileFormatStr),S("onChange"),S("onClose")})}function En(n){if(e.isOpen===!0)return e.close();e.open(n)}function S(n,t){if(e.config!==void 0){var i=e.config[n];if(i!==void 0&&i.length>0)for(var o=0;i[o]&&o=0&&j(n,e.selectedDates[1])<=0}function ve(){e.config.noCalendar||e.isMobile||!e.monthNav||(e.yearElements.forEach(function(n,t){var i=new Date(e.currentYear,e.currentMonth,1);i.setMonth(e.currentMonth+t),e.config.showMonths>1||e.config.monthSelectorType==="static"?e.monthElements[t].textContent=ue(i.getMonth(),e.config.shorthandCurrentMonth,e.l10n)+" ":e.monthsDropdownContainer.value=i.getMonth().toString(),n.value=i.getFullYear().toString()}),e._hidePrevMonthArrow=e.config.minDate!==void 0&&(e.currentYear===e.config.minDate.getFullYear()?e.currentMonth<=e.config.minDate.getMonth():e.currentYeare.config.maxDate.getMonth():e.currentYear>e.config.maxDate.getFullYear()))}function Ie(n){var t=n||(e.config.altInput?e.config.altFormat:e.config.dateFormat);return e.selectedDates.map(function(i){return e.formatDate(i,t)}).filter(function(i,o,l){return e.config.mode!=="range"||e.config.enableTime||l.indexOf(i)===o}).join(e.config.mode!=="range"?e.config.conjunction:e.l10n.rangeSeparator)}function J(n){n===void 0&&(n=!0),e.mobileInput!==void 0&&e.mobileFormatStr&&(e.mobileInput.value=e.latestSelectedDateObj!==void 0?e.formatDate(e.latestSelectedDateObj,e.mobileFormatStr):""),e.input.value=Ie(e.config.dateFormat),e.altInput!==void 0&&(e.altInput.value=Ie(e.config.altFormat)),n!==!1&&S("onValueUpdate")}function Tn(n){var t=L(n),i=e.prevMonthNav.contains(t),o=e.nextMonthNav.contains(t);i||o?Ee(i?-1:1):e.yearElements.indexOf(t)>=0?t.select():t.classList.contains("arrowUp")?e.changeYear(e.currentYear+1):t.classList.contains("arrowDown")&&e.changeYear(e.currentYear-1)}function Fn(n){n.preventDefault();var t=n.type==="keydown",i=L(n),o=i;e.amPM!==void 0&&i===e.amPM&&(e.amPM.textContent=e.l10n.amPM[H(e.amPM.textContent===e.l10n.amPM[0])]);var l=parseFloat(o.getAttribute("min")),s=parseFloat(o.getAttribute("max")),v=parseFloat(o.getAttribute("step")),d=parseInt(o.value,10),C=n.delta||(t?n.which===38?1:-1:0),f=d+v*C;if(typeof o.value<"u"&&o.value.length===2){var g=o===e.hourElement,E=o===e.minuteElement;fs&&(f=o===e.hourElement?f-s-H(!e.amPM):l,E&&x(void 0,1,e.hourElement)),e.amPM&&g&&(v===1?f+d===23:Math.abs(f-d)>v)&&(e.amPM.textContent=e.l10n.amPM[H(e.amPM.textContent===e.l10n.amPM[0])]),o.value=O(f)}}return u(),e}function te(a,r){for(var e=Array.prototype.slice.call(a).filter(function(D){return D instanceof HTMLElement}),c=[],u=0;u ",confirmText:"OK ",showAlways:!1,theme:"light"};function Kn(a){var r=ce(ce({},Wn),a),e,c="flatpickr-confirm";return function(u){return u.config.noCalendar||u.isMobile?{}:ce({onKeyDown:function(h,D,w,p){var F=Z(p),k=!u.config.time_24hr&&F===u.amPM||u.config.time_24hr&&(u.config.enableSeconds&&F===u.secondElement||!u.config.enableSeconds&&F===u.minuteElement);u.config.enableTime&&p.key==="Tab"&&k?(p.preventDefault(),e.focus()):p.key==="Enter"&&F===e&&u.close()},onReady:function(){e=u._createElement("div",c+" "+(r.showAlways?"visible":"")+" "+r.theme+"Theme",r.confirmText),e.tabIndex=-1,e.innerHTML+=r.confirmIcon,e.addEventListener("click",u.close),u.calendarContainer.appendChild(e),u.loadedPlugins.push("confirmDate")}},r.showAlways?{}:{onChange:function(h,D){var w=u.config.enableTime||u.config.mode==="multiple"||u.loadedPlugins.indexOf("monthSelect")!==-1,p=u.calendarContainer.querySelector("."+c);if(p){if(D&&!u.config.inline&&w&&p)return p.classList.add("visible");p.classList.remove("visible")}}})}}var tn=Kn;var an=function(a,r,e){return e.months[r?"shorthand":"longhand"][a]};var ke=function(){return ke=Object.assign||function(a){for(var r,e=1,c=arguments.length;ee.config.maxDate&&(m=e.config.maxDate),e.currentYear=m.getFullYear()),e.currentYearElement.value=String(e.currentYear),e.rContainer){var b=e.rContainer.querySelectorAll(".flatpickr-monthSelect-month");b.forEach(function(x){x.dateObj.setFullYear(e.currentYear),e.config.minDate&&x.dateObje.config.maxDate?x.classList.add("flatpickr-disabled"):x.classList.remove("flatpickr-disabled")})}p()}function k(m){m.preventDefault(),m.stopPropagation();var b=Z(m);if(b instanceof Element&&!b.classList.contains("flatpickr-disabled")&&!b.classList.contains("notAllowed")&&(_(b.dateObj),e.config.closeOnSelect)){var x=e.config.mode==="single",N=e.config.mode==="range"&&e.selectedDates.length===2;(x||N)&&e.close()}}function _(m){var b=new Date(e.currentYear,m.getMonth(),m.getDate()),x=[];switch(e.config.mode){case"single":x=[b];break;case"multiple":x.push(b);break;case"range":e.selectedDates.length===2?x=[b]:(x=e.selectedDates.concat([b]),x.sort(function(N,W){return N.getTime()-W.getTime()}));break}e.setDate(x,!0),p()}var I={37:-1,39:1,40:3,38:-3};function P(m,b,x,N){var W=I[N.keyCode]!==void 0;if(!(!W&&N.keyCode!==13)&&!(!e.rContainer||!c.monthsContainer)){var $=e.rContainer.querySelector(".flatpickr-monthSelect-month.selected"),B=Array.prototype.indexOf.call(c.monthsContainer.children,document.activeElement);if(B===-1){var Q=$||c.monthsContainer.firstElementChild;Q.focus(),B=Q.$i}W?c.monthsContainer.children[(12+B+I[N.keyCode])%12].focus():N.keyCode===13&&c.monthsContainer.contains(document.activeElement)&&_(document.activeElement.dateObj)}}function K(){var m;((m=e.config)===null||m===void 0?void 0:m.mode)==="range"&&e.selectedDates.length===1&&e.clear(!1),e.selectedDates.length||D()}function M(){r._stubbedCurrentMonth=e._initialDate.getMonth(),e._initialDate.setMonth(r._stubbedCurrentMonth),e.currentMonth=r._stubbedCurrentMonth}function q(){r._stubbedCurrentMonth&&(e._initialDate.setMonth(r._stubbedCurrentMonth),e.currentMonth=r._stubbedCurrentMonth,delete r._stubbedCurrentMonth)}function ae(){if(c.monthsContainer!==null)for(var m=c.monthsContainer.querySelectorAll(".flatpickr-monthSelect-month"),b=0;bI||M<_?K.classList.remove("inRange"):K.classList.add("inRange")}}function e(){var D=a.latestSelectedDateObj;D!==void 0&&D.getMonth()===a.currentMonth&&D.getFullYear()===a.currentYear&&(a.weekStartDay=a.days.childNodes[7*Math.floor(a.selectedDateElem.$i/7)].dateObj,a.weekEndDay=a.days.childNodes[7*Math.ceil(a.selectedDateElem.$i/7+.01)-1].dateObj);for(var w=a.days.childNodes,p=w.length;p--;){var F=w[p].dateObj;F>=a.weekStartDay&&F<=a.weekEndDay&&w[p].classList.add("week","selected")}}function c(){for(var D=a.days.childNodes,w=D.length;w--;)D[w].classList.remove("inRange")}function u(){a.daysContainer!==void 0&&a.daysContainer.addEventListener("mouseover",r)}function h(){a.daysContainer!==void 0&&a.daysContainer.removeEventListener("mouseover",r)}return{onValueUpdate:e,onMonthChange:e,onYearChange:e,onOpen:e,onClose:c,onParseConfig:function(){a.config.mode="single",a.config.enableTime=!1,a.config.dateFormat=a.config.dateFormat?a.config.dateFormat:"\\W\\e\\e\\k #W, Y",a.config.altFormat=a.config.altFormat?a.config.altFormat:"\\W\\e\\e\\k #W, Y"},onReady:[u,e,function(){a.loadedPlugins.push("weekSelect")}],onDestroy:h}}}var on=qn;function Jn(a){return{state:a.state,mode:"light",attribs:a.attribs??{},packageConfig:a.packageConfig??{},fp:null,get darkStatus(){return window.matchMedia("(prefers-color-scheme: dark)").matches},get getMode(){return localStorage.getItem("theme")?localStorage.getItem("theme"):(this.mode=this.darkStatus?"dark":"light",this.mode)},get darkLightAssetUrl(){return this.darkStatus?this.attribs.darkThemeAsset:this.attribs.lightThemeAsset},init:function(){this.mode=this.darkStatus?"dark":"light";let r={mode:this.attribs.mode,time_24hr:!0,altFormat:"F j, Y",disableMobile:!0,initialDate:this.state,allowInvalidPreload:!1,static:!1,defaultDate:this.state,...this.packageConfig,plugins:[new tn({confirmText:"OK",showAlways:!1,theme:this.mode})]};if(this.getMode==="dark"){let e=document.querySelector("#pickr-theme");console.log(e),e&&(e.href=this.attribs.darkThemeAsset)}this.attribs.monthSelect?r.plugins.push(new rn({shorthand:!1,dateFormat:a.packageConfig.dateFormat??"F Y",altInput:a.packageConfig.altInput??!0,theme:this.mode})):this.attribs.weekSelect&&r.plugins.push(new on({})),this.fp=nn(this.$refs.picker,r),this.fp.parseDate(this.state,this.packageConfig.dateFormat),window.addEventListener("theme-changed",e=>{this.mode=e.detail;let c;this.mode==="dark"?c=this.attribs.darkThemeAsset:c=this.attribs.themeAsset,document.querySelector("#pickr-theme").href=c})}}}export{Jn as default};
diff --git a/src/Forms/Components/Flatpickr.php b/src/Forms/Components/Flatpickr.php
index b5a9cb3..9f448f0 100644
--- a/src/Forms/Components/Flatpickr.php
+++ b/src/Forms/Components/Flatpickr.php
@@ -146,17 +146,23 @@ public function getConfig(): array
$this->enableTime(false);
$this->time(false);
$this->range(false);
- $this->dateFormat('Y-m');
- $this->altFormat('F J');
- $this->altInput();
+ if (Str::of($this->getDateFormat())->contains('d', ignoreCase: true)) {
+ $this->dateFormat('Y-m'); // Setting default date format to Y-m if no date format is set by user
+ }
+ if (Str::of($this->getAltFormat())->contains('d', ignoreCase: true)) {
+ $this->altFormat('F Y'); // Setting default alt format to F Y if no alt format is set by user
+ }
} elseif ($this->isWeekSelect()) {
$this->mode(FlatpickrMode::SINGLE);
$this->enableTime(false);
$this->time(false);
$this->range(false);
- $this->dateFormat('W');
- $this->altFormat('\Week W');
- $this->altInput();
+ if (Str::of($this->getDateFormat())->contains(['d', 'y'], ignoreCase: true)) {
+ $this->dateFormat('W'); // Setting default date format to W if no date format is set by user
+ }
+ if (Str::of($this->getAltFormat())->contains(['d', 'y'], ignoreCase: true)) {
+ $this->altFormat('\Week W'); // Setting default alt format to Week W if no alt format is set by user
+ }
}
$config = [
'monthSelect' => $this->monthSelect,
From b26eb8f73a033c3b99664e359a71545182728b18 Mon Sep 17 00:00:00 2001
From: Alexandre <8642690+alexandrevega@users.noreply.github.com>
Date: Mon, 18 Sep 2023 14:34:48 +0000
Subject: [PATCH 2/3] Fix resolve STR
---
src/Forms/Components/Flatpickr.php | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/Forms/Components/Flatpickr.php b/src/Forms/Components/Flatpickr.php
index 9f448f0..6d79306 100644
--- a/src/Forms/Components/Flatpickr.php
+++ b/src/Forms/Components/Flatpickr.php
@@ -146,10 +146,10 @@ public function getConfig(): array
$this->enableTime(false);
$this->time(false);
$this->range(false);
- if (Str::of($this->getDateFormat())->contains('d', ignoreCase: true)) {
+ if (\Str::of($this->getDateFormat())->contains('d', ignoreCase: true)) {
$this->dateFormat('Y-m'); // Setting default date format to Y-m if no date format is set by user
}
- if (Str::of($this->getAltFormat())->contains('d', ignoreCase: true)) {
+ if (\Str::of($this->getAltFormat())->contains('d', ignoreCase: true)) {
$this->altFormat('F Y'); // Setting default alt format to F Y if no alt format is set by user
}
} elseif ($this->isWeekSelect()) {
@@ -157,10 +157,10 @@ public function getConfig(): array
$this->enableTime(false);
$this->time(false);
$this->range(false);
- if (Str::of($this->getDateFormat())->contains(['d', 'y'], ignoreCase: true)) {
+ if (\Str::of($this->getDateFormat())->contains(['d', 'y'], ignoreCase: true)) {
$this->dateFormat('W'); // Setting default date format to W if no date format is set by user
}
- if (Str::of($this->getAltFormat())->contains(['d', 'y'], ignoreCase: true)) {
+ if (\Str::of($this->getAltFormat())->contains(['d', 'y'], ignoreCase: true)) {
$this->altFormat('\Week W'); // Setting default alt format to Week W if no alt format is set by user
}
}
From 8aed2824f7babcaba2c6d3578c2396f33fa118db Mon Sep 17 00:00:00 2001
From: Alexandre <8642690+alexandrevega@users.noreply.github.com>
Date: Mon, 18 Sep 2023 14:37:38 +0000
Subject: [PATCH 3/3] Recover default altFormat
---
resources/js/components/flatpickr.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/resources/js/components/flatpickr.js b/resources/js/components/flatpickr.js
index e63e99f..cdd71b2 100644
--- a/resources/js/components/flatpickr.js
+++ b/resources/js/components/flatpickr.js
@@ -54,6 +54,7 @@ export default function flatpickrDatepicker(args) {
shorthand: false, //defaults to false
dateFormat: args.packageConfig.dateFormat ?? "F Y", //defaults to "F Y"
altInput: args.packageConfig.altInput ?? true,
+ altFormat: args.packageConfig.altFormat ?? "F, Y",
theme: this.mode // defaults to "light"
}))
} else if (this.attribs.weekSelect) {