james246
james246

Reputation: 1904

HTML5 date input on Android 4.4 browser / webview

I've noticed an issue where the native datepicker that pops up when tapping a <input type="date" /> field on the Android 4.4 (KitKat) browser or webview shows the wrong date. See the following example:

<html>
<head>
  <meta name="viewport" content="width=device-width, user-scalable=no">
  <title>test</title>
</head>
<body>
  <form>
    <input type="date" value="2014-10-26" />
  </form>
</body>
</html>

Renders just fine (in my local format of DD/MM/YYYY automatically):

ok

But.. when you tap the field to open the datepicker it defaults to today's date!

notok

Anyone else experienced this issue? Maybe my value attribute isn't in the correct format? (I've tried others such as DD/MM/YYYY, but those render with a blank input field)

Upvotes: 3

Views: 4350

Answers (1)

Gabriel Caffaratti
Gabriel Caffaratti

Reputation: 56

It seems this is a specific issue in WebViews for Android 4.4.2. There's an issue opened for this bug:

In WebView input type time and date (Nexus 7)

I'm dealing with the same issue, so I hope they solve it.

I'll let you know if I can find any workaround.

Thanks!

Upvotes: 2

Related Questions