Giter Site home page Giter Site logo

daterangepicker's Introduction

daterangepicker

a simple daterangepicker

DEMO

Click here

What achieved

  1. calendar component base on moment.js
  2. date simple picker
  3. date range picker
  4. date terminal picker

compatibility for IE

  • Because of using browserify, if you don't need hour and minute picker, it supports IE9.
  • If you need hour and minute picker, because of using range input, it supports IE10.

Usage

This component relies on moment and moment-range, so you should include them first

Include js and css in /dist by tag , you can also require js by require('date-range-picker')

  var configs1 = {
    lang: 'zh-cn', // using language
    numberOfCalendars: 1, // displaying month number
    type: 'single', // single, range, terminal
    time: true, // display hours and minutes or not
    date: moment('2015-10-01'), // default date for type single
    range: moment.range(['2015-10-01', '2015-10-08']), default range for type range or terminal
    onSelect: function(date/range) {
      //...
    } // callback after select, return date or range with moment and moment-range object
  }
  /**
  * Get a dom object named such as el1 first
  */
  var drp1 = new DateRangePicker(el1, configs1);
  console.log(drp1.date) // current date for type
  console.log(drp1.range) // current range for type range and terminal
  console.log(drp1.time.hours) // current hours array
  console.log(drp1.time.minutes) // current minutes array

Develop

  $ git clone && make dev

TODO

Easily transform to angular directive or react component (in new project)

daterangepicker's People

Contributors

youngerheart avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.