【问题标题】:p calendar readonly not working in primengp 日历只读在 primeng 中不起作用
【发布时间】:2022-12-31 05:00:08
【问题描述】:

<p-calendar readonly="true" [showTime]="true" inputId="time" [hourFormat]="24" [minDate]="minDate" [maxDate]="tomorrow" inputId="range" [(ngModel )]="obj.date" formControlName="selectedDateTime">

【问题讨论】:

    标签: angular primeng angular-bootstrap-calendar


    【解决方案1】:

    采用[只读输入] =“真”代替只读=“真”

    注意 - readonlyInput 指定时,防止使用键盘手动输入日期。默认值为空

    参考 - https://www.primefaces.org/primeng/showcase/#/calendar

    【讨论】:

      【解决方案2】:

      只读财产不存在于p日历.您可以使用“禁用" 属性代替。

          <p-calendar 
          disabled="true" 
          [showTime]="true" 
          inputId="time" 
          [hourFormat]="24" 
          [minDate]="minDate" 
          [maxDate]="tomorrow" 
          inputId="range" 
          [(ngModel)]="obj.date" 
          formControlName="selectedDateTime"></p-calendar>
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-12-03
        • 1970-01-01
        • 2022-12-11
        • 2018-03-07
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多