Hi there, I have encountered an issue with setting the default date format (YYYY-MM-DD) in the UI Bootstrap datepicker input field using momentjs. Everything seems to display correctly until I try to console log the selected date. It appears that an additional day is being added along with a timezone (T00:00:00.000Z). Here's a snippet of my HTML code:
<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>
And here is a piece of my JavaScript code:
$scope.bookloan.drawdown_ent_date = moment().format("YYYY-MM-DD");
I'm puzzled as to what could be causing this discrepancy. Any insights would be greatly appreciated. Thank you.