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

universal-datepicker

v1.5.1

Published

Pure 8kb Vanilla Javascript plug and play datepicker

Readme

Table of Contents

About The Project

Lightweight datepicker component for your projects. It's fully compatible with any frameworks/libraries (React, Vue, Angular, ecc...). Light fast and customizable. Partially inspired by airbnb/react-dates.

Built With

This library does not have any dependencies. It's fully and totally pure vanilla javascript. We only used devDependencies to write modern code, beautify and bundle it:

Getting Started

This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.

  1. Clone the repo
git clone https://github.com/TheBous/universal-datepicker.git
  1. Install NPM packages
yarn
  1. Start your locally application
yarn start

Configurable options

  1. DOMElement: DOM element to which the calendar should be attached (es. body, #app)

  2. today: Pass today from the parent application, so calendar can avoid to adapt itself to internalization and/or timezones. Today could be a js Date, a string formatted with YYYY/MM/DD or an object { year, month, day }

  3. initialDate: selected date to fit calendar to the right month/year on the splash screen

  4. weekdaysLabels: Array of weekdays label in current language

  5. monthsLabels: Array of months label in current language

  6. checkin: checkin in javascript date format (checkin: new Date()).

  7. checkout: checkout in javascript date format (checkout: new Date()).

  8. orientation: calendar orientation : vertical with scroll or horizontal with arrows (horizontal|vertical).

  9. horizontalPages: number of calendar page per view in horizontal view.

  10. verticalPages: number of calendar page per view in vertical view.

  11. onCheckinChange: (function) callback triggered with new checkin date (dd/mm/yyyy) .

  12. onCheckoutChange: (function) callback triggered with new checkout date (dd/mm/yyyy) .

  13. maxCheckin: max number of days between checkin and checkout (default = 30)

  14. leftArrowClassname: Class to add some icon style to left arrow

  15. rightArrowClassname: Class to add some icon style to right arrow

  16. showTodayDate: Boolean to show a custom UI for today date cell

  17. customCheckinElement: DOM element to customize checkin calendar cell (ex ) customizable with position relative-absolute

  18. customCheckoutElement: DOM element to customize checkout calendar cell (ex ) customizable with position relative-absolute

Installation

1: Install NPM packages

yarn add universal-datepicker

2: Add these lines when you want to show calendar

const UniversalCalendar = require("universal-datepicker");
const calendar = new UniversalCalendar({configs here})

3: Add a DOM element in your own project. Coincides with the DOMElement configuration

<div id="calendar"></div>

4: Horizontal arrows to switch months are <i></i>. You need to pass to application a class to these icons with leftArrowClassname and rightArrowClassname

{
  ...,
  leftArrowClassname: "my-custom-right-arrow-class",
  rightArrowClassname: "my-custom-right-arrow-class"
}

5: Add custom css hooking to existing classes

In order to add some style customization, you need to override these CSS classes (optional):

  • calendar__wrapper: calendar generic wrapper
  • calendar__wrapper--horizontal: calendar wrapper with horizontal orientation
  • calendar__wrapper--vertical: calendar wrapper with horizontal orientation
  • calendar__weekday: Each generic weekday on the top of calendar
  • calendar__header: Header with month - year values
  • calendar__arrow-wrapper: Horizontal calendar arrows wrapper
  • calendar__arrow : Arrow to change month in horizontal view
  • calendar__arrow--left: Arrow left
  • calendar__arrow--right: Arrow right
  • calendar__cell: Each generic calendar day
  • calendar__cell--past: A past day in calendar
  • calendar__cell--checkin: Selected checkin in calendar
  • calendar__cell--checkout: Selected checkout in calendar
  • calendar__cell--range: Date between checkin and checkout
  • calendar__cell--today: Today date
  • calendar__cell--today-highlighted: Rule to custom today highlighting date
  • calendar__cell__decorator: Decorator for checkin and checkout cells

Limits

With minor 1.2.0 a user can select a date up to 1 year from now.

Contact

TheBous - @the_bous - [email protected]