AngularUI datepicker 允许输入超出范围的值 [英] AngularUI datepicker allows typing value outside of range

查看:28
本文介绍了AngularUI datepicker 允许输入超出范围的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用 AngularUI 指定具有某些允许输入值范围的日期选择器时遇到问题.例如,用户可以选择从 2013-06-10 到 2013-06-20 的日期.只要用户在日期选择器内部单击,这就可以正常工作,但是当用户键入超出范围的日期时,它就无法正常工作.在这种情况下,它会将模型更新为键入的值,但会恢复到 ui 中的范围.

I'm having an issue where I'm using AngularUI to specify a datepicker with some allowed range of input values. For example, the user can select a date from 2013-06-10 to 2013-06-20. This works fine as long as the user is clicking inside the datepicker, but it does not work correctly when the user types a date outside of the range. In that case it will update the model to the typed value but revert back to the range in the ui.

这里有一个 plnkr 演示了这个问题:http://plnkr.co/kmU8vM6OGNsus0Upp02g.尝试输入一个超出允许范围的值.

Here's a plnkr that demonstrates the issue: http://plnkr.co/kmU8vM6OGNsus0Upp02g. Try typing a value that is outside of the allowed range.

有没有其他人遇到过这个问题?是否有错误修复或解决方法?

Has anybody else experienced this problem? Is there a bugfix or workaround?

推荐答案

新插件版本解决了这个问题:https://github.com/angular-ui/ui-date.所以解决方案是停止使用捆绑的"angular-ui,而是开始使用插件版本.

This has been solved with the new plugin version: https://github.com/angular-ui/ui-date. So solution is to stop using "bundled" angular-ui and instead start using the plugin versions instead.

这篇关于AngularUI datepicker 允许输入超出范围的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆