在 Protoplasm DatePicker 中禁用日期

Disable dates in Protoplasm DatePicker

我在我的一个应用程序中使用 ProtoPlasm Datepicker,现在我想禁用比今天早的所有日期。

我使用了以下代码:

Protoplasm.use('datepicker').transform('input[type="text"].xyz_datepicker', {dateFormat: 'MM/dd/yyyy'});

但是我还是做不到。有帮助吗?

我对Protoplasm不熟悉;但是,根据他们的文档,您应该可以这样做:

Protoplasm.use('datepicker')
    .transform('input.datepicker', { 'minDate' : '1/1/2016' })

参考。 http://jongsma.org/software/protoplasm/control/datepicker

但是,我不推荐这种方法。我建议只使用 jQuery UI 概述的标准 https://jqueryui.com/datepicker/#min-max

我已通过将以下代码行添加到我的 js 文件来解决此问题:

Protoplasm.use('datepicker').transform('input.datepicker', { 'minDate' : '1/1/2016' })