Skip to content

paula-stacho/rangepicker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published