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 🙏

© 2024 – Pkg Stats / Ryan Hefner

calendarify

v2.0.4

Published

[![npm version](https://badge.fury.io/js/calendarify.svg)](https://badge.fury.io/js/calendarify) [![npm weekly downloads](https://img.shields.io/npm/dw/calendarify.svg)](https://www.npmjs.com/package/calendarify)

Downloads

247

Readme

Calendarify

npm version npm weekly downloads

Calendarify is a simple and lightweight Vanilla JavaScript datepicker library.

Screenshots

Calendarify light Calendarify dark

Shortlinks

Installation

NPM

npm i calendarify

PNPM

pnpm add calendarify

JSDelivr

<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/mohamadadithya/calendarify@latest/dist/calendarify.min.css">
<script src="https://cdn.jsdelivr.net/gh/mohamadadithya/calendarify@latest/dist/calendarify.iife.js"></script>

Statically

<link rel="stylesheet" type="text/css" href="https://cdn.statically.io/gh/mohamadadithya/calendarify/master/dist/calendarify.min.css">
<script src="https://cdn.statically.io/gh/mohamadadithya/calendarify/master/dist/calendarify.iife.js"></script>

UNPKG

<link rel="stylesheet" type="text/css" href="https://unpkg.com/calendarify@latest/dist/calendarify.min.css">
<script src="https://unpkg.com/calendarify@latest/dist/calendarify.iife.js"></script>

How to use

ES6

import Calendarify from "calendarify"

const calendarify = new Calendarify('.date-input', { ...options })
calendarify.init() // Initialize calendarify

CDN

Include calendarify.min.css in the <head> first

<head>
  ...
  <link rel="stylesheet" type="text/css" href="https://unpkg.com/calendarify@latest/dist/calendarify.min.css" />
</head>

and then include calendarify.iife.js just above your closing </body> tag...

<body>
  ...
  <input type="text" class="date-input" id="date-input" />
  ...
  <script src="https://unpkg.com/calendarify@latest/dist/calendarify.iife.js"></script>
</body>

If you downloaded the package via zip file from Github, these files are located in the dist folder. Otherwise, you can use the CDNs as shown in the Installation.

const calendarify = new Calendarify('.date-input', { ...options })
calendarify.init() // Initialize calendarify

Options

const options = {
  accentColor: '#0090FC', // You can customize the accent color
  isDark: true, // You can enable/disable dark mode
  zIndex: 9999, // You can set z-index, default is 1000
  customClass: ['font-poppins'], // You can add custom class to the calendarify element
  onChange: (calendarify) => console.log(calendarify), // You can trigger whatever function in this callback property (e.g. to fetch data with passed date parameter)
  quickActions: true, // You can enable/disable quick action (Today, Tomorrow, In 2 Days) buttons
  locale: { // You can set locale for calendar
    format: "DD-MM-YYYY", // Set Custom Format with Moment JS
    lang: {
      code: 'id', // Set country code (e.g. "en", "id", etc)
      months: ['Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus', 'September', 'Oktober', 'November', 'Desember'], // Or you can use locale moment.months instead
      weekdays: ['Minggu', 'Senin', 'Selasa', 'Rabu', 'Kamis', 'Jumat', 'Sabtu'], // Or you can use locale moment.weekdays instead
      ui: { // You can set locale text for quick action buttons
        quickActions: {
          today: "Hari Ini",
          tomorrow: "Besok",
          inTwoDays: "Lusa",
        }
      }
    }
  }
}

Types

accentColor

  • Type: String
  • Default: #0090FC

Customize the accent color

isDark

  • Type: Boolean
  • Default: false

Enable/disable dark mode

zIndex

  • Type: String | Number
  • Default: 1000

Set calendarify element z-index, default is 1000

customClass

  • Type: String[]
  • Default: []

Add custom classes to the calendarify element

onChange

  • Type: Callback
  • Default: null

Trigger whatever function in this callback property (e.g. to fetch data with passed date parameter)

quickActions

  • Type: Boolean
  • Default: false

Enable/disable quick action (Today, Tomorrow, In 2 Days) buttons

format

  • Type: String
  • Default: YYYY-MM-DD

Set output date format with Moment JS

code

  • Type: String
  • Default: en

Set country code (e.g. "en", "id", etc)

months

  • Type: String[]
  • Default: ['January', 'February', ...]

Set locale month names / Or you can use locale moment.months() instead

weekdays

  • Type: String[]
  • Default: ['Sunday', 'Monday', ...]

Set locale month names / Or you can use locale moment.weekdays() instead

today

  • Type: String
  • Default: Today

set today locale text for quick action buttons

tomorrow

  • Type: String
  • Default: Tomorrow

set tomorrow locale text for quick action buttons

inTwoDays

  • Type: String
  • Default: in 2 Days

set in 2 days locale text for quick action buttons

File Sizes

dist/calendarify.min.css    3.82 kB   │ gzip:  1.03 kB
dist/calendarify.js         129.57 kB │ gzip: 35.95 kB
dist/calendarify.umd.cjs    99.48 kB  │ gzip: 31.91 kB
dist/calendarify.cjs        99.23 kB  │ gzip: 31.82 kB
dist/calendarify.iife.js    99.28 kB  │ gzip: 31.83 kB