1.3.0 • Published 5 years ago

jquery-dropdown-datepicker v1.3.0

Weekly downloads
58
License
ISC
Repository
github
Last release
5 years ago

jQuery Dropdown Datepicker

A simple and customization dropdown datepicker plugin made with jQuery.

Check Examples

Installation

jQuery is required to use this plugin

Package manager

Using npm

npm i jquery-dropdown-datepicker

Using yarn

yarn add jquery-dropdown-datepicker

Using bower

bower install jquery-dropdown-datepicker

Using CDN

<script src="https://cdn.jsdelivr.net/npm/jquery-dropdown-datepicker@1.3.0/dist/jquery-dropdown-datepicker.min.js"></script>

OR

<script src="https://unpkg.com/jquery-dropdown-datepicker@1.3.0/dist/jquery-dropdown-datepicker.min.js"></script>

Usage

$("#date").dropdownDatepicker({
    defaultDate: '2019-04-07',
    displayFormat: 'dmy',
    monthFormat: 'short',
    minYear: 2000,
    maxYear: 2020
});

Options

OptionTypeDefultComment
defaultDatestringnull
defaultDateFormatstring'yyyy-mm-dd'
displayFormatstring'dmy'
submitFormatstring'yyyy-mm-dd'
minAgeintnull
maxAgeintnull
minYearintnull
maxYearintnull
minDatestringnullyyyy-mm-dd
maxDatestringnullyyyy-mm-dd
allowPastbooleantrue
allowFuturebooleantrue
submitFieldNamestring'date'
wrapperClassstring'date-dropdowns'
dropdownClassstringnull
daySuffixesbooleantrue
monthSuffixesbooleantrue
monthFormatstring'long'
requiredbooleanfalse
dayLabelstring'Day
monthLabelstring'Month'
yearLabelstring'Year'
sortYearstring'desc'
monthLongValuesarray'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'
monthShortValuesarray'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
initialDayMonthYearValuesarray'Day', 'Month', 'Year'
daySuffixValuesarray'st', 'nd', 'rd', 'th'

Events

onChange

Call on any change of day,month or year dropdown

$("#date").dropdownDatepicker({
    onChange: function(day, month, year){
        console.log(day, month, year);
    }
});

onDayChange

Call on any change of day dropdown

$("#date").dropdownDatepicker({
    onDayChange: function(day, month, year){
        console.log(day, month, year);
    }
});

onMonthChange

Call on any change of month dropdown

$("#date").dropdownDatepicker({
    onMonthChange: function(day, month, year){
        console.log(day, month, year);
    }
});

onYearChange

Call on any change of year dropdown

$("#date").dropdownDatepicker({
    onYearChange: function(day, month, year){
        console.log(day, month, year);
    }
});

Methods

destroy

Call the destroy method to undo any changes made during the plugin's initialisation.

$("#date").dropdownDatepicker('destroy');

Contributing

Contributing Feel free to submit any fixes or propose any additional functionality via pull request or issue, making sure any changes take place in /src. Any code changes must pass the JSHint validation, and where possible also update the minified file.

Minification and Validation Both are automated via Grunt. Run npm install to install the required dependencies, then run grunt from the root of the project to handle the tasks.

License

ISC

Thanks Giving

This plugin is made based on jquery-date-dropdowns

Thanks to IckleChris

1.3.0

5 years ago

1.2.5

5 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago