rangepicker

0.3.5 • Public • Published

rangepicker

Date Range Comparison Picker

a simple jQuery date picker, useful especially for selecting two date ranges for comparison

Library uses MomentJS for date handling.

Installation

Download node at nodejs.org and install it, if you haven't already.

npm install rangepicker --save

Usage

Datepicker container

    <div id="datepicker" style="float: right"></div>

Activate rangepicker

        <script>
            $('#datepicker').rangepicker(options);
        </script>

Options

These options can be specified:

    <Selecting>
  maxDate: 
  	'Max selectable date'
  	'Format: YYYY-MM-DD'
  	'Default: none'
  minDate: 
  	'Min selectable date'
  	'Format: YYYY-MM-DD'
  	'Default: none'
  futureEnabled: 
  	'If not, only allow dates until today'
  	'Format: boolean'
  	'Default: true'
  months: 
  	'Number of months displayed on datepicker'
  	'Format: int'
  	'Default: 3'
  lastMonthDisplayed: 
  	'Last month displayed on datepicker'
  	'Format: YYYY-MM-DD'
  	'Default: this month'

  <Intervals>
  defaultStart,
  defaultEnd,
  defaultCompareStart,
  defaultCompareEnd:
  	'Initial intervals.'
  	'Format: YYYY-MM-DD'
  	'Defaults: last week and week before'
  defaultCompareType:
  	'There are three compare interval types: custom, mirror and lastYear'
  	'Format: string'
  	'Default: custom'

  <Callbacks>
  onChange
  onHide
  onShow
  onMonthChange

No options are required.

Dependencies

  • jquery: JavaScript library for DOM operations
  • moment: Parse, validate, manipulate, and display dates

Dev Dependencies

License

ISC

Generated by package-json-to-readme

Package Sidebar

Install

npm i rangepicker

Weekly Downloads

2

Version

0.3.5

License

ISC

Unpacked Size

156 kB

Total Files

11

Last publish

Collaborators

  • orechova