I have date with specific date format mentioned bellow.
Date_received = Tue Apr 05 2016 00:00:00 GMT+0530 (India Standard Time)
I'm getting this value using HTML5
input type="date" datepicker. I want to initialise the following 'min' attribute.
<input type="date" id="endDate" ng-model="user.endDate" min="" required />
I'm using
var startDate = new Date(Date_received).toISOString().split('T')[0];
var myEl = angular.element( document.querySelector( '#endDate' ) );
myEl.attr('min',startDate);
But this(new Date(Date_received).toISOString()
) sets the value of startDate one day before the actual date. i.e. in this example it sets value of startDate = 2016-04-04T18:30:00.000Z