Reputation: 65870
I'm using angular date picker.But it gives below error.Could you tell me how to sort out it. Thanks in advance.
HTML
<input type="date" uib-datepicker-popup ng-model="vm.property.deedDate"
is-open="status.opened" datepicker-options="vm.dateOptions"
date-disabled="disabled(date, mode)" ng-required="true" close-text="Close" />
JS
vm.property = {};
vm.init = function () {
propertyService.getPropertyForEdit({
id: propertyId
}).success(function (result) {
vm.property = result.property;
vm.property.deedDate = moment(vm.property.deedDate);
});
};
vm.init();
Returning from Web Api :
Web Api Dto object :
public class PropertyEditDto : IOutputDto
{
public int Id { get; set; }
public DateTime DeedDate { get; set; }
}
It gives below mentioned console error :
Upvotes: 1
Views: 1906
Reputation: 2105
please try this:
vm.property.deedDate = new Date(vm.property.deedDate);
it should works !
Upvotes: 5