Set min date to current date in angularJS input

前端 未结 5 776
梦如初夏
梦如初夏 2020-12-30 02:59

In AngularJS, how can we set the min attribute of input type=\"date\" to current date (today\'s) ?



        
5条回答
  •  执笔经年
    2020-12-30 03:42

    correct answers are already in above, if anyone looking for a solution in Angular 2/4/5 here is a way,

    in you .ts file

    private todate = new Date();
    

    in your html file,

     
    

    also here you can file other format options available in Angular

    date formats

提交回复
热议问题