You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importMaskedInputfrom"react-text-mask/dist/reactTextMask.js";// تبدیل اعداد فارسی یا عربی به انگلیسی functiontoEnglishNumber(str){constpersianDigits=[/۰/g,/۱/g,/۲/g,/۳/g,/۴/g,/۵/g,/۶/g,/۷/g,/۸/g,/۹/g];constarabicDigits=[/٠/g,/١/g,/٢/g,/٣/g,/٤/g,/٥/g,/٦/g,/٧/g,/٨/g,/٩/g];for(leti=0;i<10;++i){str=str.replace(persianDigits[i],i).replace(arabicDigits[i],i);}returnstr;}// کامپوننت ورود تاریخexportfunctionDateMaskInput({
value,
handleValueChange,
openCalendar,
mask =[/\d/,/\d/,/\d/,/\d/,"/",/\d/,/\d/,"/",/\d/,/\d/],}){return(<MaskedInputmask={mask}format="yyyy/mm/dd"inputMode="numeric"onFocus={openCalendar}value={toEnglishNumber(value.toString())}placeholderChar={"-"}showMaskonChange={(e)=>{let[year,month,day]=e.target.value.split("/");e.target.value=`${year}/${month}/${day}`;handleValueChange(e);}}/>);}
وقتی کاربر تاریخ و دستی تایپ میکنه قابلیتش و داره که اسلش خودکار بیفته؟
The text was updated successfully, but these errors were encountered: