如何在 Angular 材料日期范围选择器表单中设置上午/下午
我正在使用来自角度材料的日期范围选择器形式。当我选择日期范围时,比如说 3 月 1 日至 3 月 4 日,我得到的结束日期是 3 月 4 日 12:00pm,不是应该是 3 月 4 日 11:59pm 吗?如何解决这个问题。
这是我的演示代码: 演示
I am using Date range picker forms from angular material. When I pick date range let say 1mar-4mar I get end date 4 mar 12:00pm isn't it should be 4 mar 11:59pm? how to solve this problem.
Here is my demo code: Demo
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Angular Materials 目前不支持时间选择...
如果您查看了 DatePicker 的文档,你会注意到它没有提到时间选择。
这就是你面临的问题。这是该功能的问题跟踪器
要解决您的时间问题,您需要实施时间处理的智能与普通的 Materials DatePicker 结果分开,或者使用具有时间选择功能的第三方组件。
Angular materials does not support time picking at the moment...
If you have look at the documentation for DatePicker's, you will notice it does not mention time picking.
That's the issue you are facing. Here is the issue tracker for the feature
To resolve your time issue you will need to implement the smarts of time handling separately from the vanilla Materials DatePicker results, or use a third party component with time picking capabilities.