Giter Club home page Giter Club logo

monthpicker's Introduction

MonthPicker widget

Version 0.1.0

A month picker for jQuery.

Built upon jQuery UI widget factory (http://api.jqueryui.com/jQuery.widget/).

Dependencies: jQuery, jQuery UI widget factory

Demo: http://cinemathequefr.github.io/MonthPicker/

Instantiation

$(".someElement").monthPicker(options);

Options

An options object can be passed to the constructor with the following properties:

Parameter Description Default
minDate (String) Lower year/month, "yyyy-mm" null
maxDate (String) Upper year/month "yyyy-mm" null
selectedDate (String) Selected year/month, "yyyy-mm" null
isOpen (Boolean) Is the calendar initially open (expanded)? false
monthShortNames (Array) Months -- short names [null, "Jan", "Fév"..."Déc"]
monthLongNames (Array) Months -- long names [null, "Janvier", "Février"..."Décembre"]
select (Function) Callback invoked when the selected date changes noop

Month names defaults are in French. Note that the value at index 0 is ignored (the month indices follow the month numbers).

API

Options can't currently be updated dynamically once the widget is instantianted (TODO). An API provides simple methods to interact programmatically with the widget.

Verb Example Remark
setDate $(el).monthPicker("setDate", "2010-10");
$(el).monthPicker("setDate"); No date selected
open $(el).monthPicker("open"); Open calendar
close $(el).monthPicker("close"); Close calendar
toggle $(el).monthPicker("toggle"); Toggle open/close

monthpicker's People

Contributors

nltesown avatar

Watchers

Quijaua 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.