ngx-material-timepicker 不适用于 IE 和 Edge

ngx-material-timepicker not working on IE and Edge

当我们点击时间选择器输入时,它会打开时间选择器,但是当我们 select 时间输入填充了无效日期。

请帮我解决这个问题。

他们的官方演示中也存在同样的问题。 https://agranom.github.io/ngx-material-timepicker/

如果我们不能在 IE 和 Edge 中使用 ngx-material-timepicker,那么请给我推荐任何一个我可以在我的 angular 8 项目中使用的很棒的时间选择器。我在设计中使用 angular material。

提前致谢。

试试 ng-bootstrap timepicker

https://ng-bootstrap.github.io/#/components/timepicker/examples

<ngb-timepicker [(ngModel)]="time"></ngb-timepicker>
<hr>
<pre>Selected time: {{time | json}}</pre>

Stackblitz Example ng-bootstrap timepicker


另一种选择可以是 ngx-bootstrap timepicker

https://valor-software.com/ngx-bootstrap/#/timepicker

<timepicker [(ngModel)]="mytime"></timepicker>
<pre class="alert alert-info">Time is: {{mytime}}</pre>

Stackblitz Example ngx-bootstrap timepicker


您也可以尝试 install/use 旧版本的 ngx-material-timepicker 并检查您的错误是否消失。例如:

npm install --save ngx-material-timepicker@4.0.2
npm install --save ngx-material-timepicker@5.0.0
npm install --save ngx-material-timepicker@5.1.0

调试后我发现 luxon 库和 IE 支持有问题。 Timepicker 在 Edge 中工作。 这是可能会帮助您解决问题的 link。 https://moment.github.io/luxon/docs/manual/matrix.html