lpernice
lpernice

Reputation: 127

Null value in Angular material md-datepicker

Is it possible to set a null value to an md-datepicker ?

<md-datepicker ng-model="vm.activity.myDate" md-placeholder="myDate" />

in my controller I tried to set date to null but it always show 1/1/1901

if (row.entity.DataSchedulazione == '')
    row.entity.DataSchedulazione = null;

Any help?

Upvotes: 0

Views: 3247

Answers (2)

RASEL RANA
RASEL RANA

Reputation: 2190

Set null in your model value vm.activity.myDate = null;

Upvotes: 0

kgfaith
kgfaith

Reputation: 240

I tried it and it doesn't show 1/1/1901. CodePen link

Your code is setting null to

row.entity.DataSchedulazione 

, instead of vm.activity.myDate though.

Upvotes: 1

Related Questions