TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Date/Time Inputs Enabled on Firefox Nightly

265 点作者 abhinickz超过 7 年前

29 条评论

greggman超过 7 年前
I&#x27;m curious about Japanese support which I think goes beyond locale.<p>Japanese often uses 24 hour times like 18:00 vs 6:00pm and while I see you can specify valid times in that format I didn&#x27;t see how to get it to display 18:00 instead of 6:00pm.<p>In the forms on this page<p><a href="https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;HTML&#x2F;Element&#x2F;input&#x2F;time" rel="nofollow">https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;HTML&#x2F;Element&#x2F;in...</a><p>When I typed 20:00 it assumed that first 2 meant 2am and then jumped to the minutes section as soon as I typed 2. Note: My system settings are set to use 24 hour time.<p>Worse, Japanese times are often in terms of the night before. So for example if you look at movie times a movie playing at 1:00am Saturday morning is listed as 25:00 Friday night.<p>I wonder if input type=time is probably going to cause more trouble than it&#x27;s worth
评论 #15533726 未加载
评论 #15535249 未加载
评论 #15563152 未加载
评论 #15535484 未加载
snitko超过 7 年前
It looks like the date is displayed in the US format mm&#x2F;dd&#x2F;yyyy which is, of course, most unnatural to all other countries. Is this customizeable, or is it automatically adjusted depending on the language preferences in the browser? If it&#x27;s the latter, it&#x27;s not cool - my preferred language for the browser is English, but I hate the US date display format with passion.<p>EDIT: oh I see, automatically adjusted, but not configurable. Bad choice it is, then.<p>EDIT2: I mean, there are so many more better and easy solutions to that problem. You could display a date with a month name in the selected language - &quot;Oct 1, 2017&quot; - or start with a year &quot;2017-10-01&quot; which would be instantly recognizable by anyone regardless of the country.
评论 #15531495 未加载
评论 #15531808 未加载
评论 #15531920 未加载
评论 #15531536 未加载
评论 #15531793 未加载
评论 #15532092 未加载
评论 #15531816 未加载
评论 #15531561 未加载
评论 #15531896 未加载
评论 #15532041 未加载
评论 #15531482 未加载
评论 #15533163 未加载
评论 #15563184 未加载
gldalmaso超过 7 年前
What is the reasoning behind the decision to not make localization configurable?<p>Can we agree that some webpages and webapps have already make the decision to control the locale through the app and not choose the environment default?<p>My OS and browser locale is pt-BR, but if for whatever reason I am not happy with a pt-BR UX, which is often, I want to be able to change it on a case by case basis.<p>For example, any documentation I look up, like say on MDN or AWS, I want to see it in english and not a poor&#x2F;incomplete translation. If I play a Star Wars game on my browser or phone I do not want any translations, I want the original terms like scoundrel instead of the translator&#x27;s choice of terms.<p>It is already bad enough as it is for the reasons I pointed out, now we are gonna have that same nightmare in forms as well?<p>Sure webapps that actually care will find a non standard way, as they already do, but then we are not actually improving when in 2017 you have to load 3rd party libs just to be able to choose the locale of a date input.<p>&lt;input type=date&gt; (environment default)<p>&lt;input type=date locale=&quot;pt-BR&quot;&gt; (actual chosen locale)<p>Is that too much to ask?
评论 #15534897 未加载
评论 #15532655 未加载
评论 #15533755 未加载
评论 #15546482 未加载
yvoschaap超过 7 年前
I think the idea behind a native datepicker for &lt;input&gt; fields is good. But the fact I can&#x27;t customize the design and UX of the datepicker interface, it always ends up being replaced by some javascript library where I can.<p>Same goes for the &lt;select&gt; input. The native one is usually always replaced by a custom designed one.
评论 #15531612 未加载
评论 #15531447 未加载
mattmanser超过 7 年前
Statements like this show how ambiguity creeps in:<p><i>All dates and times will be converted to ISO 8601 format, as specified in the spec, before being submitted to the web server.</i><p>Are you going to be appending a Z? Adding the browser&#x27;s timezone? Adding T00:00:00Z to the dates? What? No clarity at all. You can&#x27;t just hand wave and say 8601! 8601!<p>Also, we&#x27;ve had date and time pickers for over a decade now and this clearly doesn&#x27;t meet the need.<p>It&#x27;s such a shame that this is the standard they come out with.
评论 #15532100 未加载
评论 #15533590 未加载
giancarlostoro超过 7 年前
I know everyone&#x27;s ticked off about the &quot;US defaults&quot; but it&#x27;s released in a development &#x2F; testing browser, not the typical Firefox release. They&#x27;ll likely do adjustments based on feedback. I hope it becomes configurable. Definitely easier than importing some external libraries though.<p>Given how this was setup in a nightly release they&#x27;re very likely to start out &quot;a little broken.&quot;<p>Really glad this is finally being added, I&#x27;m sure there&#x27;s other features some of us wouldn&#x27;t mind in HTML out of the box.<p>Update: Realized it&#x27;s released on nightly not &quot;Developer&#x27;s&quot; edition.
评论 #15532589 未加载
finalfantasia超过 7 年前
This feature has already ridden the release train (currently in 57 beta) [1] and should be released with Firefox 57 next month.<p>[1] <a href="https:&#x2F;&#x2F;www.mozilla.org&#x2F;en-US&#x2F;firefox&#x2F;57.0beta&#x2F;releasenotes&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.mozilla.org&#x2F;en-US&#x2F;firefox&#x2F;57.0beta&#x2F;releasenotes&#x2F;</a>
abritinthebay超过 7 年前
I know “finally” is a tech cliche but it feels like this has been a REALLY long time coming.<p>Very thankful we’re starting to see this work roll out!
评论 #15531407 未加载
Yaggo超过 7 年前
Nice, but why &lt;input type=&quot;date&quot;&gt; expects U.S. format &#x27;mm&#x2F;dd&#x2F;yyyy&#x27; instead of native format used in my system?<p>If it falls back to default format, at least the default could little bit more universal&#x2F;stanard, e.g. &#x27;yyyy-mm-dd&#x27;.<p>Edit: Even after switching my preferred language from English to Finnish in browser settings, the format stays &#x27;mm&#x2F;dd&#x2F;yyyy&#x27;. I&#x27;m using Finnish region in my OS settings as well.
评论 #15531563 未加载
评论 #15531722 未加载
评论 #15531540 未加载
评论 #15531829 未加载
mdf超过 7 年前
This is very nice, but the system LC_TIME locale (and whatever the equivalent is on Windows) exists for a reason. I hope Mozilla will listen to the feedback in all these comments and consider basing the picker type on the system time locale – not on the language locale, and certainly not on the locale of the downloaded binary.<p>I use most if not all software in English, but I prefer seeing dates in the ISO format, weeks starting from Mondays and times in a 24 hour format.
评论 #15533352 未加载
oliv__超过 7 年前
OMG this feels like it should have been here AGES ago! Would have saved a lot of pain and jquery-plugin problems...<p>Great to see it here! I hope it spreads to other browsers quickly.
评论 #15531465 未加载
saagarjha超过 7 年前
TIL you can render HTML from your address bar:<p>data:text&#x2F;html, [Your HTML here]
评论 #15531428 未加载
claudius超过 7 年前
Hopefully it will stop people implementing their own date&#x2F;time pickers which only allow changing that date&#x2F;time by clicking up&#x2F;down arrows. In particular the Munich transport website (mvg.de) is guilty of this and I absolutely hate it with a passion.
评论 #15531836 未加载
ourcat超过 7 年前
I wonder if this had anything to do with Microsoft, Google, Mozilla, etc. recently deciding to consolidate web documentation at MDN. <a href="https:&#x2F;&#x2F;blog.mozilla.org&#x2F;blog&#x2F;2017&#x2F;10&#x2F;18&#x2F;mozilla-brings-microsoft-google-w3c-samsung-together-create-cross-browser-documentation-mdn&#x2F;" rel="nofollow">https:&#x2F;&#x2F;blog.mozilla.org&#x2F;blog&#x2F;2017&#x2F;10&#x2F;18&#x2F;mozilla-brings-micr...</a><p>Since I recently tried to implement a date input and was shocked to discover that Firefox didn&#x27;t support it, despite being in &#x27;their&#x27; docs. <a href="https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;HTML&#x2F;Element&#x2F;input&#x2F;date" rel="nofollow">https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;HTML&#x2F;Element&#x2F;in...</a>
评论 #15533951 未加载
评论 #15533868 未加载
评论 #15546543 未加载
ajnin超过 7 年前
One of the date examples shows a box with &quot;06&#x2F;09&#x2F;2016&quot; in it, with an error popup which says &quot;Please select a valid value. The two nearest valid values are 2016-06-06 and 2016-06-11&quot;.<p>Seems incoherent to use US date format for the box and ISO8601 format for the error message.<p>Also I wish software in general would stop trying to guess what the locale settings should be and just ask. I have my language set as en_US but I prefer to use 24h time and ISO8601 dates. With this update Firefox guesses wrongly 12h time and mm&#x2F;dd&#x2F;yyyy date format with no way to override it that I could find.
482794793792894超过 7 年前
&gt; Note that there is no picker for &lt;input type=time&gt;. We decided not to support it since we think it’s easier and faster to enter a time using the keyboard than selecting it from a picker.<p>I&#x27;ve thought this so many times, even on my phone where typing is less accessible, I still prefer it over those analogue clock face inputs.<p>With such a clock input, I&#x27;ll often hit the wrong time, either an hour&#x2F;minute too late&#x2F;early, due to my apparently fat fingers, or 12 hours wrong, because I live in a 24-hour-format region where normally on an analogue clock you read things in 12-hour-format and so my brain thinks &quot;8 pm&quot; and enters &quot;8&quot; when it should have chosen &quot;20&quot;. That doesn&#x27;t happen with typing, because digital clocks almost always display 24-hour-format.<p>And even worse, in an attempt to speed things up, someone came up with the ingenious idea of directly advancing from hour input to minute input as soon as some input has been made. So, my first few wrong inputs then mean that I have to find the way to get back to the hour selection multiple times.
ComputerGuru超过 7 年前
We&#x27;ve been using this in a corporate webapp for over two years in a Chrome environment. I can&#x27;t believe Firefox is only just getting this. You&#x27;d think basic form inputs would have a UI this late in the game without needing to pull in something like jQuery UI or similar.<p>Especially given how hard it is to implement dates and calendars correctly.
amelius超过 7 年前
Nice, but their design doesn&#x27;t match my website&#x27;s design.
评论 #15532316 未加载
ComodoHacker超过 7 年前
Side note: I was trying to think up a viable case for applying @step attribute to date input but quickly gave up.
评论 #15531764 未加载
mullsork超过 7 年前
Chrome has had this for what feels like years. Is there something new in there or did Firefox just catch up?<p>Good news in any case! The back office tool I work on is Chrome only and it&#x27;s been great to just use type=&quot;date&quot;!
评论 #15531946 未加载
ape4超过 7 年前
Any ideas on how a website should use this? Can you detect if input.date exists easily (for the current browser) without resorting to checking the brand and version of the browser?
评论 #15534834 未加载
Zash超过 7 年前
But what format is the data sent to the server in?
评论 #15534414 未加载
评论 #15531655 未加载
baxtr超过 7 年前
Can somebody explain why this is big news? It looks like a standard input to me. I&#x27;m genuinely asking...
评论 #15531478 未加载
评论 #15532312 未加载
mixedCase超过 7 年前
No week picker? Edge and Chrome implement it.
ptman超过 7 年前
finally not only in chrome (and apparently opera)
dingo_bat超过 7 年前
&gt; Note that there is no picker for &lt;input type=time&gt;. We decided not to support it since we think it’s easier and faster to enter a time using the keyboard than selecting it from a picker.<p>I wasted about 2 minutes trying to figure out how to input seconds in the embedded example. Turns out it was am&#x2F;pm. Maybe the picker can be a simple drop-down list.
评论 #15531516 未加载
mozumder超过 7 年前
This is a nice start but we basically need a full API of these to match all the widgets and view controllers you find in a full GUI environment like Mac OS&#x2F;Windows&#x2F;iOS.
评论 #15531511 未加载
Brosper超过 7 年前
Finally? God why it to them so long to implement the most basic thing :(
pette超过 7 年前
This is not newsworthy.<p>But will the inputs be mixed-reality ready?