Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Angular UI datepicker is getting wrong date

    service.ConvertDateToJSONDate = function (dateInput) {
        if (dateInput === null || dateInput === undefined) {
            return null;
        }
        //return "/Date(" + dateInput.getTime().toString() + ")/";
        return "/Date(" + (dateInput.getTime() + 10800000).toString() + ")/";
    };

Usage: service.ConvertDateToJSONDate(SelectedDateObjectToBeConverted);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Angular #UI #datepicker #wrong #date
ADD COMMENT
Topic
Name
5+5 =