I have this markup
<!--visible for permanent no-test-->
<md-content
ng-if="$ctrl.voice.isTest === false && $ctrl.voice.type === 'Permanent'"
layout="column">
<md-content layout="row">
<md-input-container>
<label>From Date</label>
<md-datepicker ng-model="$ctrl.voice.coreConditionFromUi.fromDate"
datetime="yyyy-MM-dd" md-min-date="$ctrl.today"></md-datepicker>
</md-input-container>
</md-content>
</md-content>
with this model:
function Voice() {
this.isTest = true;
this.coreConditionFromUi =
{
countries: [],
userFlag : "STAFF",
fromDate : undefined,
toDate : undefined //new Date()
}
}
When i open the datepicker it shows a date of next month.
I want it to show today's date
I saw this post, but i don't want to set new Date() in the model
as I want to allow null value.
How can i achieve that?
new Date()in the model? That seems like the easiest way to do it.nullwhen not chosen