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
{{ message }}
This repository was archived by the owner on May 29, 2019. It is now read-only.
It works fine if I select the date from the calendar popup. but if I type in the date in the input box in the format 'dd/MM/yyyy', it will recognize the 'day' as the 'month'. eg. if type in '16/03/2014', datepicker will treat 16 as the month, and generate an undefined result.
When reading the code in ui-bootstrap-tpls.js, I found the following code in the function parseDate of directive 'datepickerPopup', the viewValue is in the format 'dd/MM/yyyy', but when the Javascript Date object takes it in, it will assume the format to be 'MM/dd/yyyy' ,
var date = new Date(viewValue);
So I have made my temporary fix to replace the above line with the following, and it's now working for me, could you please fix this problem in your repo, so we dont keep this custom code in your file.
var date = null;
if(dateFormat === 'dd/MM/yyyy' || dateFormat === 'dd/MM/yy') {
var dateParts = viewValue.split("/");
date = new Date(dateParts[2], dateParts[1]-1, dateParts[0]);
} else if(dateFormat === 'dd-MM-yyyy' || dateFormat === 'dd-MM-yy') {
var dateParts = viewValue.split("-");
date = new Date(dateParts[2], dateParts[1]-1, dateParts[0]);
} else {
date = new Date(viewValue);
}
The text was updated successfully, but these errors were encountered:
i face this broblem and i dont get solution i have model date type when i pass json date MM/dd/yyyy
it chose the correct date but i make format dd/MM/yyyy on the datpicer html it show correct date with wrong format , if i pass json Date object in the format dd/MM/yyyy then it make month as a day and Day as a Month , how can i solve this Prblem ( correct Date , Correct Format )
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
hello there,
I'm having a problem using the datepicker plugin with the format dd/MM/yyyy , I have my datepicker initialized as below.
It works fine if I select the date from the calendar popup. but if I type in the date in the input box in the format 'dd/MM/yyyy', it will recognize the 'day' as the 'month'. eg. if type in '16/03/2014', datepicker will treat 16 as the month, and generate an undefined result.
When reading the code in ui-bootstrap-tpls.js, I found the following code in the function parseDate of directive 'datepickerPopup', the viewValue is in the format 'dd/MM/yyyy', but when the Javascript Date object takes it in, it will assume the format to be 'MM/dd/yyyy' ,
So I have made my temporary fix to replace the above line with the following, and it's now working for me, could you please fix this problem in your repo, so we dont keep this custom code in your file.
The text was updated successfully, but these errors were encountered: