简体   繁体   中英

meteor.js How to choose prohibit retroactive date in the package “tsega:bootstrap3-datetimepicker”

I have a question about the package "tsega:bootstrap3-datetimepicker".

In the template I have placed code:

                    <div class="nowe-wydarzenie form-group">
                  <label class="control-label" for="nowe-wydarzenie-start-date">Data</label>
                   <div class="input-group datetimepicker">
                      <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                      <input type="text" class="form-control" id="nowe-wydarzenie-start-date" data-id="nowe-wydarzenie-start-date" name="noweWydarzenieStartDate" placeholder="Podaj datę rozpoczecia wydarzenia" autocapitalize="none" autocorrect="off" value="">
                    </div>
                    <span class="help-block hide"></span>
                </div>

and the js file I added the following code:

Template.newWydarzenie.onRendered(function() {
    this.$('.datetimepicker').datetimepicker({
    });
});

With these settings, I have the opportunity to choose the date of bark already passed (01.01.2016)

I would like to block such a choice.

How to set the this package so that it was not possible to select reverse date.

Use minDate option. This line:

this.$('.datetimepicker').datetimepicker({ minDate: 'now' });

allow only future dates.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM