<small id='TomMj'></small><noframes id='TomMj'>

        <i id='TomMj'><tr id='TomMj'><dt id='TomMj'><q id='TomMj'><span id='TomMj'><b id='TomMj'><form id='TomMj'><ins id='TomMj'></ins><ul id='TomMj'></ul><sub id='TomMj'></sub></form><legend id='TomMj'></legend><bdo id='TomMj'><pre id='TomMj'><center id='TomMj'></center></pre></bdo></b><th id='TomMj'></th></span></q></dt></tr></i><div id='TomMj'><tfoot id='TomMj'></tfoot><dl id='TomMj'><fieldset id='TomMj'></fieldset></dl></div>
        • <bdo id='TomMj'></bdo><ul id='TomMj'></ul>
        <legend id='TomMj'><style id='TomMj'><dir id='TomMj'><q id='TomMj'></q></dir></style></legend>
        <tfoot id='TomMj'></tfoot>

        Angular 2 Ionic 2 - 如何将最大或最小日期设置为今天

        时间:2023-09-07

        <small id='Gus7g'></small><noframes id='Gus7g'>

          <bdo id='Gus7g'></bdo><ul id='Gus7g'></ul>

            <tbody id='Gus7g'></tbody>

          1. <tfoot id='Gus7g'></tfoot>
                • <i id='Gus7g'><tr id='Gus7g'><dt id='Gus7g'><q id='Gus7g'><span id='Gus7g'><b id='Gus7g'><form id='Gus7g'><ins id='Gus7g'></ins><ul id='Gus7g'></ul><sub id='Gus7g'></sub></form><legend id='Gus7g'></legend><bdo id='Gus7g'><pre id='Gus7g'><center id='Gus7g'></center></pre></bdo></b><th id='Gus7g'></th></span></q></dt></tr></i><div id='Gus7g'><tfoot id='Gus7g'></tfoot><dl id='Gus7g'><fieldset id='Gus7g'></fieldset></dl></div>
                • <legend id='Gus7g'><style id='Gus7g'><dir id='Gus7g'><q id='Gus7g'></q></dir></style></legend>
                  本文介绍了Angular 2 Ionic 2 - 如何将最大或最小日期设置为今天以进行日期输入?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                   <input class="alert-input date-input" #dob="ngModel" name="dob" max="2018-03-07" [(ngModel)]="leadDetail.dob" type="date"></div>
                  

                  How can I set the max date for today instead of 2018-03-07 dynamically?

                  I tried following methods-

                   <input  max="today" type="date"></div>
                   <input  max="{{today | date:'yyyy-mm-dd'}}" type="date"></div>
                  

                  Class -

                  public today = new Date();
                  

                  but no luck.

                  解决方案

                  Try this:

                  <input class="alert-input date-input" name="dob" [max]="today" type="date">
                  
                  
                  today = new Date().toJSON().split('T')[0];
                  

                  Working Example Demo

                  Reason:

                  Because when you are using new Date() this will give you full date with time zone and time etc, you have to assign only Date so you have to split this with only Date. For more clarification run this:

                  console.log(new Date(), '----', new Date().toJSON());
                  

                  这篇关于Angular 2 Ionic 2 - 如何将最大或最小日期设置为今天以进行日期输入?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:Angular2指令修改点击处理 下一篇:Ionic 2 占位符文本样式

                  相关文章

                  最新文章

                  <tfoot id='pyn4m'></tfoot>

                • <legend id='pyn4m'><style id='pyn4m'><dir id='pyn4m'><q id='pyn4m'></q></dir></style></legend>
                • <i id='pyn4m'><tr id='pyn4m'><dt id='pyn4m'><q id='pyn4m'><span id='pyn4m'><b id='pyn4m'><form id='pyn4m'><ins id='pyn4m'></ins><ul id='pyn4m'></ul><sub id='pyn4m'></sub></form><legend id='pyn4m'></legend><bdo id='pyn4m'><pre id='pyn4m'><center id='pyn4m'></center></pre></bdo></b><th id='pyn4m'></th></span></q></dt></tr></i><div id='pyn4m'><tfoot id='pyn4m'></tfoot><dl id='pyn4m'><fieldset id='pyn4m'></fieldset></dl></div>

                      <small id='pyn4m'></small><noframes id='pyn4m'>

                        <bdo id='pyn4m'></bdo><ul id='pyn4m'></ul>