0.4.3 • Published 8 years ago

datablejs v0.4.3

Weekly downloads
7
License
ISC
Repository
github
Last release
8 years ago

About

datable.js is a lightweight, customizable, bootstraps-friendly jQuery plugin to properly format dates in inputs and verify that the date is valid.

Install

After downloading datable, just include the file right above the closing <body> tag and then initialize the function.

<script type="text/javascript" src="datable.min.js"></script>

<script> $('input[data-datable]').datable();</script>

That's all! Your options are handled through custom data attributes in each element.

Attributes

data-datable - any combination of dd, mm, yyor yyyy in any order is accepted.

data-datable-divider - default value is / but can be set to any string.

data-datable-era - either a date string formatted as such: yyyy,mm,dd or an array formatted as [yyyy,mm,dd]. A string is an exact date, while an array is any combination of positive or negative numbers that will offset from the current date

data-datable-era2 - if not referenced, the second point in the era will be today's date. Follows the same rules as data-datable-era

Demo

View the demo for instructions!