Coder Social home page Coder Social logo

coverhound / date-input-polyfill Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jcgertig/date-input-polyfill

0.0 16.0 0.0 184 KB

Automatically adds datepickers to input[type=date] on IE, Firefox, and OS X Safari.

Home Page: https://www.npmjs.com/package/date-input-polyfill

License: MIT License

JavaScript 87.83% CSS 6.96% HTML 5.21%

date-input-polyfill's Introduction

date-input-polyfill

Just include this simple script and IE, Firefox, and OS X Safari will support <input type="date">, without any dependencies, not even jQuery!

Support dynamically created inputs, so can be used in single page applications.

Forked from nodep-date-input-polyfill. Continuing as a separate project.

Install

npm install --save date-input-polyfill

Add to your project:

  • Webpack/Browserify: require('date-input-polyfill');

    or alongside Babel: import 'date-input-polyfill';

  • Script Tag: Copy date-input-polyfill.dist.js from node_modules and include it anywhere in your HTML.

  • This package also supports AMD.

Features

  • Easily Stylable: These are the default styles, which you may override with your own.

  • Polyfills valueAsDate and valueAsNumber: Learn more about these properties. They behave as getters and setters.

  • Keyboard Shortcuts: Esc will hide the datepicker. Up/Down will increment/decrement the date by one day.

  • Localization: Specify the datepicker's locale by setting the lang attribute of the input element. The default locale is en.

    <input type="date" lang="en" />

  • Formatting: Specify the display format by setting either the date-format or data-date-format attribute of the input element. The default format is yyyy-mm-dd. Available options list.

    <input type="date" date-format="mm/dd/yyyy" />

    <input type="date" data-date-format="mm/dd/yyyy" />

Contributing

Local Development

Run npm start or, for Cloud9 IDE users: npm run start-c9

Build

Run npm run build

date-input-polyfill's People

Contributors

brianblakely avatar liorwohl avatar jcgertig avatar toddwelstein avatar lucasghizoni avatar sbibauw avatar shanshanyang avatar wingleung avatar

Watchers

David Verba avatar Grant Jeffers avatar James Cloos avatar Bernardo Farah avatar George Groh avatar Nathan Seither avatar Joe Chambers avatar Joe Lewis avatar Sam Eng avatar Dylan Wright avatar  avatar Sean Mulligan avatar Mikhail Shnayder avatar  avatar Jack Plane avatar JV avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.