balbarak / bootstrap-hijri-datepicker

Bootstrap Hijri Date picker
MIT License
56 stars 53 forks source link

Date picker is not opening when we set the hijri date hijriFormat:"iYYYY-iMMM-iDD" and not opening and if locale set ar-SA for format : DD-MMM-YYYY. #30

Open pankaj16061982 opened 3 years ago

pankaj16061982 commented 3 years ago

Its show the month in arabic as local is ar-SA, but when we click again on text box it shows error in console..

1errorinarbaic 2localerror

pankaj16061982 commented 3 years ago

Hi Can you please reply on this issue?

righithabet commented 2 years ago

Update this function parseInputDate line 13659 in bootstrap-hijri-datetimepicker.js will work success

Change it with this code

parseInputDate = function(inputDate) { if (options.parseInputDate === undefined) { if (moment.isMoment(inputDate) || inputDate instanceof Date) { inputDate = moment(inputDate); } else { inputDate = getMoment(inputDate); } } else { inputDate = options.parseInputDate(inputDate); }

            if (inputDate === undefined) {
                return null;
            }

            inputDate.locale(options.locale);
            return inputDate;
        },