better-timeinput-polyfill icon indicating copy to clipboard operation
better-timeinput-polyfill copied to clipboard

input[type=time] polyfill for better-dom

better-timeinput-polyfill Build Status

input[type=time] polyfill for better-dom

LIVE DEMO

Features

  • does nothing on mobile browsers and normalizes the widget for desktop browsers
  • live extension - works for current and future content
  • supports US variant of time with AM/PM selectbox (just use lang="en-US" on <html>)
  • fully customizable via css classes
  • restores initial value on parent form reset
  • allows to set value programmatically, but the string should be in ISO (HH:mm) format

Installing

Use bower to download this extension with all required dependencies.

bower install better-timeinput-polyfill --save

This will clone the latest version of the better-timeinput-polyfill into the bower_components directory at the root of your project.

Then append the following html elements on your page:

<html>
<head>
    ...
    <link href="bower_components/better-timeinput-polyfill/dist/better-timeinput-polyfill.css" rel="stylesheet"/>
    <!--[if IE]>
        <link href="bower_components/better-dom/dist/better-dom-legacy.htc" rel="htc"/>
        <script src="bower_components/better-dom/dist/better-dom-legacy.js"></script>
    <![endif]-->
</head>
<body>
    ...
    <script src="bower_components/better-dom/dist/better-dom.js"></script>
    <script src="bower_components/better-timeinput-polyfill/dist/better-timeinput-polyfill.js"></script>
</body>
</html>

Browser support

  • Chrome
  • Safari 6.0+
  • Firefox 16+
  • Opera 12.10+
  • IE8+