我正在使用 PrimeNG 日历的时间选择器,并具有以下代码:
<p-calendar class="due-time" name="time-due" timeOnly="true" showTime="showTime" hourFormat="12" stepMinute="15" readonlyInput="readonlyInput"
[(ngModel)]="TimeDue" (ngModelChange)="updateTimeDue()"></p-calendar>
这一切都工作正常,除了我希望分钟增加/减少 15 之外,尽管添加了 stepMinute="15"
,如上所示,分钟仍然增加/减少1.我尝试将其更改为 [stepMinute]="15"
,但这给了我以下错误:
Can't bind to 'stepMinute' since it isn't a known property of 'p-calendar'. 1. If 'p-calendar' is an Angular component and it has 'stepMinute' input, then verify that it is part of this module. 2. If 'p-calendar' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schemas' of this component to suppress this message.
如果我将其更改为 [attr.stepMinute]="15"
,那么它会消除错误,但它会返回到向上和向下 1。我该怎么做让 stepMinute
真正发挥作用?
最佳答案
两个示例(stepMinute="15"和 [stepMinute]="15")效果都很好。
您使用的是哪个版本的 PrimeNG 日历?
关于angular - stepMinute 在 PrimeNG 的日历中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42405600/