Blinddate was created as an accessible extension to pickadate.js. It was largely inspired by this mashup of pickadate.js and date.js. We decided to use Moment.js for our projects, and so created this plugin to use moment instead of date.js.
Pickadate's picker.js and picker.date.js must be included before using blinddate.
Blinddate will automatically use Sugar or Moment when available. If both are available, blinddate will
use Sugar, since it allows more user-friendly date input. If neither are available, blinddate will
fallback to plain, old Javascript new Date()
.
Note: Blinddate will look for Moment on the global window
object since it's not possible to
test the existence of AMD or Node modules.
Blinddate usage is identical to pickadate.
$('.datepicker-simple').blinddate();
$('.datepicker-advanced').blinddate({
format: 'mmmm dd, yyyy',
formatDisplay: 'LL',
formatSubmit: 'mm/dd/yyyy',
selectYears: 100,
selectMonths: true,
min: new Date(1900, 0, 1),
max: new Date(),
today: false,
clear: false,
parser: 'moment'
});
Blind date supports all of pickadate's options, with two additions:
Formatting options to pass through to the parser. This overrides pickadate's format
option.
Parser | Description | Default Value (and Example) |
---|---|---|
Native | Uses pickadate's formats | "d mmmm, yyyy" (26 October, 1985) |
Moment | Uses Moment's date formats | "LL" (October 21, 2015) |
Sugar | Uses Sugar's date formats | "short" (November 12, 1955) |
Specifies which parser to use. This shouldn't be necessary outside of our demo and tests.
$('#datepicker').blinddate({
parser: 'native'
});
$('#momentpicker').blinddate({
parser: 'moment'
});
$('#sugarpicker').blinddate({
parser: 'sugar'
});
Successfully tested in Chrome 38, Firefox 31, IE 9 and IE 11.
Originally developed by Vecna Technologies, Inc. and open sourced as part of its community service program. See the LICENSE file for more details. Vecna Technologies encourages employees to give 10% of their paid working time to community service projects. To learn more about Vecna Technologies, its products and community service programs, please visit http://www.vecna.com.