Datepicker

A simple date selection component.

Arguments

  • target - parent selector (defines scope)
  • startSelector - start date input selector
  • endSelector - end date input selector
  • pickFuture - enables picking future dates
  • pickPast - enables picking past dates
  • selectMonths - enables months selecting
  • selectYears - enables years selecting

Example

Demo

Markup

<div class="js-datepicker">
  <input class="js-datepicker__start" placeholder="Pick start date" />
  <input class="js-datepicker__end" placeholder="Pick end date" />
</div>

Javascript

new Datepicker({
  target:         ".js-datepicker",
  startSelector:  ".js-datepicker__start",
  endSelector:    ".js-datepicker__end",
  pickFuture:     true,
  pickPast:       true,
  selectMonths:   true,
  selectYears:    true
});