浏览器不再支持日期时间选择器吗? [英] Do browsers no longer support date time picker?

查看:115
本文介绍了浏览器不再支持日期时间选择器吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找一个简单的标准日期时间选择器,很多网站都说:

 < input type =datetimename =formStartDate> 

应该生成支持的日期时间选择器,但我没有这样的运气,我真的不想要通过导入和下载整个框架和文档的过程,这样一个简单的功能......

好吧,因为它不再被支持是否有一个简单的如何在没有大量框架的情况下获得一个?或者认真地删除它而不提供别的东西?



好吧,这很好!除了我只能在页面上工作,我想要两个。我认为这与这两个代码段通过id进行通信并且必须具有唯一性有关。你可以帮我在同一页面上多次工作吗?

 < html lang =en> 
< head>
< meta charset =utf-8>
< title> jQuery UI Datepicker - 默认功能< / title>
< link rel =stylesheethref =// code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css\">
< script src =// code.jquery.com/jquery-1.10.2.js\">< ;;script>
< script src =// code.jquery.com/ui/1.11.4/jquery-ui.js\"></script>
< link rel =stylesheethref =/ resources / demos / style.css>
< script>
$(function(){
$(#datepicker).datepicker();
});
< / script>
< / head>
< body>

< p>日期:< input type =textid =datepicker>< / p>


< / body>
< / html>


解决方案

根据W3School的说法,Chrome中不支持此功能,Firefox或Internet Explorer: http://www.w3schools.com/html /tryit.asp?filename=tryhtml_input_datetime



下面是关于他们为什么取消支持的解释:为什么HTML5输入类型的日期时间已从支持它的浏览器中删除?



你可以在网络上找到很多选择(使用JavaScript),jQueryUI实现了一个: https://jqueryui.com/datepicker/


I have been searching around for a simple standard date time picker and a lot of the websites say that:

<input type="datetime" name="formStartDate">

Should produce a supported date time picker but I am having no such luck and I really don't want to go through the process of importing and downloading a whole bunch a frameworks and documents for such a simple feature...

Ok so since it's no longer supported is there a simple way to get one without a ton of frameworks? Or did the seriously just delete it without providing something else?

Ok that works great! except for I can only have one working on the page and I would like two. I think it has to do with the fact that these two snippets communicate through id and those have to unique. Can you please help me get multiple working on the same page?

<html lang="en">
<head>
  <meta charset="utf-8">
  <title>jQuery UI Datepicker - Default functionality</title>
  <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
  <script src="//code.jquery.com/jquery-1.10.2.js"></script>
  <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
  <link rel="stylesheet" href="/resources/demos/style.css">
<script>
  $(function() {
    $( "#datepicker" ).datepicker();
  });
</script>
</head>
<body>

<p>Date: <input type="text" id="datepicker"></p>


</body>
</html>

解决方案

According to W3School, this feature is not supported in Chrome, Firefox, or Internet Explorer : http://www.w3schools.com/html/tryit.asp?filename=tryhtml_input_datetime

Here's an explanation about why they removed the support : Why is HTML5 input type datetime removed from browsers already supporting it?

You can find many alternatives (using JavaScript) around the web, jQueryUI implements one : https://jqueryui.com/datepicker/

这篇关于浏览器不再支持日期时间选择器吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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