在ipad IOS 5 safari上输入日期...问题 [英] Date input on ipad IOS 5 safari... questions

查看:89
本文介绍了在ipad IOS 5 safari上输入日期...问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力调整现有的Web应用程序,使其更适合ipad。它使用jquery日期选择器,它可以很好地工作,直到你登上ipad。在ipad环境中,它间歇性地工作,但总是很尴尬,因为键盘覆盖了日历小部件。



我只是扩展了jquery日期选择器功能。除非我们在ipad上,否则扩展只调用标准的jquery日期选择器代码。如果是ipad,那么我用< input type =date替换目标输入... />



这让我更接近,但是它表现得很间歇。

1.我无法弄清楚如何获取日期输入以显示我设置的任何值。我也尝试将属性date =设置为原始值。我也尝试格式化YYY-DD-MM格式的值/日期属性中的日期,而不是默认的MM / DD / YYYY格式。



2.在某些情况下,当我使用它自动使用的ipad日期选择器小部件设置日期时,控件上不会显示任何内容。大部分时间它都很完美,但有些令人沮丧的罕见案例根本无法使用。



我甚至下载了针对windows(cringes)的safari来尝试并看看它做了什么,它的日期输入真的很蹩脚。我用来设置开始值的日期格式在您尝试编辑之前显示正常。如果我点击进行编辑,它会跳到今天的日期并从那里进行编辑。



我的感觉是作为safari实现它的日期输入实际上很糟糕。我一直在谷歌搜索,没有找到任何有意义的东西。



那么在ipad上使用日期输入的方法是什么?除了< input type =date之外还有什么东西....还是只需要对这种方法进行微妙的调整?

I am working on tweaking an existing web application to be more ipad friendly. It uses the jquery date picker, which works great until you get on an ipad. In the ipad environment, it intermittently works, but is always awkward because the keyboard covers the calendar widget.

I simply extended the jquery date picker function. The extension just calls the standard jquery date picker code unless we are on an ipad. If it is an ipad then I replace the target input with <input type="date".../>

This gets me a lot closer, but it behaves very intermittently.
1. I cannnot figure out how to get the date input to show any value that I set. I have also tried setting the attribute date= to the original value. I also have tried formatting the date put into the value/date attribute in the YYY-DD-MM format rather than the default of MM/DD/YYYY that it starts with.

2. In some instances when I set the date using the ipad date picker widget that it automatically uses, nothing shows up on the control. Most of the time it works perfectly, but there are these frustrating rare cases that don't work at all.

I even download safari for windows(cringes) to try and see what it does, and it's date input is really lame. Either date format I use to set the value to start with appears fine until you try to edit it. If I click to edit it, it jumps to today's date and edits from there.

My feeling is that the date input as safari has implemented it is really poorly implemented. I have been googling this and haven't found anything meaningful.

So what is the approach to use for date inputs on an ipad? Is there something other than <input type="date".... or is there just a subtle tweak I need to make on that approach?

推荐答案

I与iPhone有同样的问题(1.)。我设法使用< input type =datevalue =yyyy-MM-dd... =/> ;.



确保你有MM和dd部分填充。 2011-2-9将无法运作。 2011-02-09将从我看到的工作。这就是我所缺少的。
I had the same problem (1.) with iPhone. I managed to get it working using <input type="date" value="yyyy-MM-dd" ...="" />.

Make sure you have the MM and dd parts padded. 2011-2-9 will not work. 2011-02-09 will work from what I see. That is what I was missing.


我正在尝试禁用iOS的jquery UI timepicker



使用modernizr检测如果该功能已经被支持...然后只在不是HTML5的浏览器上使用timepickers



I'm trying to disable the jquery UI timepicker for iOS

Using modernizr to detect if the feature is already supported... and then only use timepickers on browsers that aren't HTML5-ish

if (!Modernizr.inputtypes.date) {


输入[类型=日期])日期选择器();
}
("input[type=date]").datepicker(); }


这篇关于在ipad IOS 5 safari上输入日期...问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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