在iOS Phonegap App中限制本机日期选择器中的可选日期 [英] Limit the selectable dates in native datepicker in iOS Phonegap App
问题描述
我正在使用 Phonegap Build 为 iOS 开发应用程序,我正在使用输入数据类型调用本机日期选择器(没有问题),然后选择一些日期,但我想限制可选择的日期。
I'm developing an App for iOS with Phonegap Build and I'm using an input data type to call the native datepicker (without problems) and select some dates, but I want limit the selectable dates.
我尝试过 min
和 max
输入的属性,但会被忽略。已在iOS 6和iOS 7上测试。
I've tried with the min
and max
attributes of the input, but are ignored. Tested on iOS 6 and iOS 7.
以下是我的代码:
<input id="fecha-buscar" type="date" min="2014-01-01" max="2014-12-31" value="2014-01-01">
我发现这个类似的SO问题,但没有回答。
任何想法如何解决这个问题?可以修复< input type =date>的
min
和 max
属性;
Any idea how solve this? Can be fixing the min
and max
attributes of <input type="date">
or other way but calling the native datepicker of iOS.
感谢!
推荐答案
我刚刚发现一个datepicker插件phonegap / cordova,它有选项min&最大值。
https://github.com/sectore/phonegap3-ios -datepicker-plugin / tree / ios7
I just found a datepicker plugin for phonegap/cordova and it has options for min & max values. https://github.com/sectore/phonegap3-ios-datepicker-plugin/tree/ios7
这篇关于在iOS Phonegap App中限制本机日期选择器中的可选日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!