[Bug 17854] i18n-ISSUE-85: Health warning about converting date to/from incremental time

https://www.w3.org/Bugs/Public/show_bug.cgi?id=17854

--- Comment #6 from Addison Phillips <addison@lab126.com> ---
It's simple enough to demonstrate.

---

<script type="text/javascript">
function showtz() {
   var x=document.getElementById("date");
   var date = new Date(x.value);
   alert(date);

}
</script>

<form>
<p>Date: <input type="date" id="date" name="date"
onchange="showtz()"></input></p>
</form>
---

If you input "2012-10-20" into this form, the alert shown for me (in the
America/Los_Angeles time zone) contains:

   Fri Oct 19 2012 17:00:00 GMT-0700 (Pacific Daylight Time)

This is "2012-10-20 GMT", but it is not the "October 20th" that the user
expects. The above is implemented in:

   http://www.inter-locale.com/test/DateDemo.html 

That's because JavaScript 'Date' is an incremental time (it's actually a long
value).

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Received on Wednesday, 2 January 2013 18:25:19 UTC