Good day, by default I set a date in the format like this YYYY-MM-DD in the ui bootstrap datepicker input field using momentjs. The date shows correctly in the format I want it to be. when I select a different date it show correctly the input field but when I decide to console log the value a day is added to it and with a timezone (T00:00:00.000Z). here is a snippet of my html
<div class="row">
<div class="col-md-6">
<label>Drawdown Ent. Date <span style="color: red;">*</span></label>
<input type="text"
class="form-control"
datepicker-popup="yyyy-MM-dd"
ng-model="bookloan.drawdown_ent_date"
is-open="drawdown_ent_date.open"
ng-click="drawdown_ent_date.open = true"
datepicker-options="entDateOptions"
date-disabled="disabled(date, mode)"
close-text="Close" />
</div>
</div>
here is a snippit of my JavaScript code:
$scope.bookloan.drawdown_ent_date = moment().format("YYYY-MM-DD");
What could cause this? Thanks in advance..
$scope.dt = moment().format("YYYY-MM-DD");gives an error.