jquery-weekpicker

jquery-weekpicker JS library homepage jquery-weekpicker JS library on GitHub jquery-weekpicker JS library on npm Download jquery-weekpicker JS library

A weekpicker addon for jQueryUI datepicker

Version 1.0.4 License MIT Vulnerabilities 0
jquery-weekpicker JS library homepage
jquery-weekpicker JS library on GitHub
jquery-weekpicker JS library on npm
Download jquery-weekpicker JS library
Keywords
jquerydatepickerweekpickerweek

jQuery weekpicker

A weekpicker addon for the jQueryUI datepicker.

Usage

The weekpicker is an extension of the datepicker. As such, all datepicker options are supported. Example:

$('#selector').weekpicker({
    // options ...
});

There are only a three new options:

  • weekLength: The length of the week in days. Defaults to 7. Use 5 to select from e.g. Monday-Friday.
  • startField: Element or jQuery expression for an input field that will receive the start of the selected week.
  • endField: Element or jQuery expression for an input field that will receive the end of the selected week.

Tips

If you are only interested in the start of the week, you can set the startField equal to the weekpicker element. Example:

$('input.weekpicker').each(function (i, el) {
    $(el).weekpicker({
        firstDay: 1,
        startField: el
    });
});

This will override the value in the date field with the start of the week.