npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

jquery-dropdown-datepicker

v1.3.2

Published

A simple customizable jquery dropdown datepicker

Readme

jQuery Dropdown Datepicker

npm version npm downloads license open issues open pull requests

A lightweight, dependency-free (beyond jQuery) plugin that turns an <input> or a container element into three cascading day/month/year <select> dropdowns, keeping a single formatted date value in sync as the user picks.

Live examples

Features

  • Works on a plain <input> or a container element (<div>, etc.)
  • Configurable display order (dmy / mdy / ymd) and submit format
  • Age and date-range constraints (minAge/maxAge, minDate/maxDate, allowPast/allowFuture) — handy for date-of-birth or range pickers
  • i18n-friendly: every label, month name, and ordinal suffix is overridable
  • onChange / onDayChange / onMonthChange / onYearChange callbacks
  • No external dependencies other than jQuery

Requirements

jQuery >= 1.4

Installation

npm install jquery-dropdown-datepicker
yarn add jquery-dropdown-datepicker
bower install jquery-dropdown-datepicker

Or via CDN:

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery-dropdown-datepicker.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/jquery-dropdown-datepicker.min.js"></script>

Usage

<input type="text" id="date" readonly>
$("#date").dropdownDatepicker({
    defaultDate: '2019-04-07',
    displayFormat: 'dmy',
    monthFormat: 'short',
    minYear: 2000,
    maxYear: 2020
});

The plugin builds three <select> elements next to the target and keeps a formatted date value in sync — as a hidden <input> if the target is a container element, or on the target itself if it's an <input>.

Options

| Option | Type | Default | Notes | | ------------------- | ------- | ----------------- | ----- | | defaultDate | string | null | Pre-selects a date. Falls back to the target <input>'s existing value when omitted. | | defaultDateFormat | string | 'yyyy-mm-dd' | Format of defaultDate. One of 'yyyy-mm-dd', 'dd/mm/yyyy', 'mm/dd/yyyy', 'unix'. | | displayFormat | string | 'ymd' | Order the dropdowns are rendered in: 'dmy', 'mdy', or 'ymd'. | | submitFormat | string | 'yyyy-mm-dd' | Format written to the submit field. Tokens dd/mm/yyyy, or 'unix' for a Unix timestamp. | | minAge | int | null | Restricts selectable dates to at least this many years old. | | maxAge | int | null | Restricts selectable dates to at most this many years old. | | minYear | int | null | Lower bound for the year dropdown. | | maxYear | int | null | Upper bound for the year dropdown. | | minDate | string | null | yyyy-mm-dd. Lower bound for the selectable date. | | maxDate | string | null | yyyy-mm-dd. Upper bound for the selectable date. | | allowPast | boolean | true | Allow dates before today. | | allowFuture | boolean | true | Allow dates after today. | | submitFieldName | string | 'date' | name attribute of the submit field. | | wrapperClass | string | 'date-dropdowns' | Class applied to the wrapping element. | | dropdownClass | string | null | Extra class(es) applied to each <select>. | | daySuffixes | boolean | true | Show ordinal suffixes (1st, 2nd, ...) in the day dropdown. | | monthSuffixes | boolean | true | Show ordinal suffixes when monthFormat is 'numeric'. | | monthFormat | string | 'long' | 'long', 'short', or 'numeric'. | | required | boolean | false | Marks all three <select> elements as required. | | dayLabel | string | 'Day' | Placeholder option text for the day dropdown. Falsy hides the placeholder. | | monthLabel | string | 'Month' | Placeholder option text for the month dropdown. | | yearLabel | string | 'Year' | Placeholder option text for the year dropdown. | | sortYear | string | 'desc' | 'desc' or 'asc' order for the year dropdown. | | monthLongValues | array | ['January', ..., 'December'] | Full month names, overridable for i18n. | | monthShortValues | array | ['Jan', ..., 'Dec'] | Abbreviated month names, overridable for i18n. | | daySuffixValues | array | ['st', 'nd', 'rd', 'th'] | Ordinal suffixes, overridable for i18n. |

Events

onChange

Fires on any change to the day, month, or year dropdown.

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

onDayChange

Fires when the day dropdown changes.

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

onMonthChange

Fires when the month dropdown changes.

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

onYearChange

Fires when the year dropdown changes.

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

Methods

destroy

Removes the generated dropdowns and restores the target element to its pre-init state.

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

Development

npm install
npx grunt          # lint (jshint), then rebuild dist/
npx grunt jshint    # lint only

Source lives in src/jquery-dropdown-datepicker.js; dist/ is generated — don't edit it by hand. See CLAUDE.md for more on the build pipeline and known gotchas.

Contributing

Fixes and new functionality are welcome via pull request or issue. Make sure any changes take place in src/, pass npx grunt jshint, and that dist/ is rebuilt (npx grunt) and committed alongside the source change.

Changelog

See CHANGELOG.md.

License

ISC

Acknowledgements

Based on jquery-date-dropdowns by IckleChris.