简体   繁体   English

移动 IOS 输入类型日期最小值和最大值不适用于 chrome 和 safari

[英]Mobile IOS input type date min and max not working on chrome and safari

I have the following cshtml which works perfectly on Android, Windows and Mac safari and chrome.我有以下 cshtml 可以在 Android、Windows 和 Mac safari 和 chrome 上完美运行。

<input type="date" min="1900-01-01" max="@DateTime.Now.AddYears(-18).ToString("yyyy-MM-dd")" />

However when using my iPhone it ignores both the min and max values both on Chrome and Safari.但是,当使用我的 iPhone 时,它会忽略 Chrome 和 Safari 上的最小值和最大值。

Has anyone encountered the above issue and if so do you know why it wouldn't be working specifically for IOS mobile?有没有人遇到过上述问题,如果有,您知道为什么它不适用于 IOS 手机吗?

It appears that this has already been asked here: Html 5 [input type=Date] control, MAX date is not working in iPhone/Ipad看来这里已经问过了: Html 5 [input type=Date] control, MAX date is not working in iPhone/Ipad

The answer indicates that iOS doesn't support these attributes and recommends using a separate JavaScript date picker library, such as Pickaday .答案表明 iOS 不支持这些属性,并建议使用单独的 JavaScript 日期选择器库,例如Pickaday

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM