Skip to content

Commit 74bb47a

Browse files
authored
Update datepicker.js
1 parent 6a3db38 commit 74bb47a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

datepicker.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function Datepicker(isHijr,year,month,firstDay,lang,theme,width){
1515
if(typeof HijriDate=='undefined')throw new Error('HijriDate() class required!');
1616
const MIN_WIDTH=280,MAX_WIDTH=600;
1717
let dp=typeof this=='object'?this:window,gdate=new Date(),hdate=new HijriDate(),pgdate=new Date(),phdate=new HijriDate(),dispDate,pickDate,
18-
tzOffset=Date.parse('01 Jan 1970'),isAttached=false,oldTheme,gridAni='zoom',isRTL=false,
18+
tzOffset=Date.parse('01 Jan 1970'),oldTheme,gridAni='zoom',isRTL=false,
1919
aboutElm,aboutTitleElm,aboutDateElm,aboutCloseBtnElm,
2020
createElm=function(tagName,className,innerHTML){
2121
let el=document.createElement(tagName);if(className)el.className=className;if(innerHTML)el.innerHTML=innerHTML;return el
@@ -173,7 +173,7 @@ function Datepicker(isHijr,year,month,firstDay,lang,theme,width){
173173
if(el)el.className=el.className.replace('w3-'+oldTheme,'w3-'+theme)
174174
}
175175
};
176-
dp.attachTo=function(el){if(el.appendChild&&!isAttached){el.appendChild(dpickElm);isAttached=true;return true}return false};
176+
dp.attachTo=function(el){if(el.appendChild&&!dpickElm.parentNode){el.appendChild(dpickElm);return true}return false};
177177
dp.getElement=function(){return dpickElm};
178178
dp.getOppositePickedDate=function(){return getOppsPDate()};
179179
dp.getPickedDate=function(){return pickDate};

0 commit comments

Comments
 (0)