Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 this issue Apr 30, 2021 · 2 comments

Comments

@pankaj16061982
Copy link

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
Copy link
Author

Hi Can you please reply on this issue?

@pankaj16061982 pankaj16061982 changed the title Date picker is not opening when we set the hijri date hijriFormat:"iYYYY-iMMM-iDD" Date picker is not opening when we set the hijri date hijriFormat:"iYYYY-iMMM-iDD" and not opening if locale set ar-SA for format : DD-MMM-YYYY. May 10, 2021
@pankaj16061982 pankaj16061982 changed the title Date picker is not opening when we set the hijri date hijriFormat:"iYYYY-iMMM-iDD" and not opening if locale set ar-SA for format : DD-MMM-YYYY. 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. May 10, 2021
@righithabet
Copy link

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;
        },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants