限制 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">
我发现了这个类似的问题,但没有回答.
I found this similar SO question, but without answer.
知道如何解决这个问题吗?可以修复 的
min
和 max
属性或其他方式,但调用 nativeiOS 的日期选择器.
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.
谢谢!
推荐答案
我刚刚找到了一个用于 phonegap/cordova 的 datepicker 插件,它有 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屋!