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

@anuz-pandey/nepali-date-picker

v2.2.1

Published

Lightweight, Powerful JavaScript Nepali Date Picker with no dependencies.

Downloads

33

Readme

Nepali Date Picker

NPM Version Download Count

Lightweight, Powerful JavaScript Nepali Date Picker with no dependencies.

branding-image.png

INSTALLATION

1. Install via NPM

npm install @anuz-pandey/nepali-date-picker
# Or Yarn
yarn add @anuz-pandey/nepali-date-picker
# Or Pnpm
pnpm add @anuz-pandey/nepali-date-picker
# Or Bun
bun add @anuz-pandey/nepali-date-picker

2. Installation for Non-Module Environments

  • 2.1. Download the latest release Download and extract the zip file and copy the files from dist folder to your project.

  • 2.2. Use a standalone build

    <!-- Add to the end of body section -->
    <script src="dist/nepali-date-picker.bundle.js"></script>
OR

3. Use separate files (JS and CSS)

<!-- Add to the head section -->
<link rel="stylesheet" href="dist/nepali-date-picker.min.css">

<!-- Add to the end of body section -->
<script src="dist/nepali-date-picker.min.js"></script>

4. CDN


<script src="https://cdn.jsdelivr.net/npm/@anuz-pandey/nepali-date-picker/dist/nepali-date-picker.bundle.min.js"></script>

<!-- OR -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@anuz-pandey/nepali-date-picker/dist/nepali-date-picker.min.css">
<script src="https://cdn.jsdelivr.net/npm/@anuz-pandey/nepali-date-picker/dist/nepali-date-picker.min.js"></script>

USAGE

If you’re using a bundler, e.g. webpack, you’ll need to import NepaliDatePicker and the CSS file.

// esp. modules are recommended, if available, especially for typescript
import NepaliDatePicker from '@anuz-pandey/nepali-date-picker'

// CommonJS
const NepaliDatePicker = require('@anuz-pandey/nepali-date-picker')

All the following are valid ways to create flatpickr instance.

// Initialize Nepali Date Picker
new NepaliDatePicker('.date-picker')
// --- OR ---
new NepaliDatePicker('#date-of-birth')
// --- OR ---
new NepaliDatePicker('selector', config) // See Config Options below

Config Options

let config = {
    format: 'YYYY-MM-DD',           // 'YYYY-MM-DD', 'YYYY/MM/DD', 'YYYY.MM.DD', 'DD-MM-YYYY', 'DD/MM/YYYY', 'DD.MM.YYYY'  
    disableAfterToday: false,       // boolean: true | false
    disableBeforeToday: false,      // boolean: true | false
    disableToday: false,            // boolean: true | false
    closeOnDateSelect: true,        // boolean: true | false
    markHolidays: true,             // boolean: true | false
    holidays: ['Saturday'],         // ['Saturday', 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday']
    indicateCurrentDate: true,      // boolean: true | false
    setCurrentDate: false,          // boolean: true | false
    position: 'left',               // 'left', 'right' or 'center'
    daysFormat: 'dd',               // 'ddd' for full day name, 'dd' for short day name, 'd' for 1 letter day name
    locale: 'np',                   // 'np' for nepali, 'en' for english
    theme: 'flat',                  // bordered | soft | flat
    darkMode: false,                // boolean: true | false
    inline: false,                  // boolean: true | false
}

English Date to Nepali Date Conversion

// To Convert English Date to Nepali Date
let NepaliDatePicker = new NepaliDatePicker();
NepaliDatePicker.convertToNepaliDate(1996, 4, 22)
// Result: {year: 2053, month: 1, day: 10}

Features

| Feature | Status | |---------------------------------------------------------|--------------| | Proper UI for Date Picker | ✅ Done | | Convert English Date to Nepali Date | ✅ Done | | Convert Nepali Date to English Date | ⬜ Not Done | | Add Date Picker to Multiple Input Fields | ✅ Done | | Remove jQuery Dependency | ✅ Done | | Support Time Select | ⬜ Not Done | | Calculate Age on Date | ⬜ Not Done | | Inline Calendar | ✅ Done | | Add Configurations to Date Picker | ⬜ Not Done | | Close/Hide Date Picker on Date Select | ✅ Done | | ------------------------------------------------------- | ------------ | | Disable on Today's Date | ✅ Done | | Disable on Before Today's Date | ✅ Done | | Disable on Before After Today's Date | ✅ Done | | Disable on Specific Dates | ⬜ Not Done | | Disable on Specific Days | ⬜ Not Done | | Disable on Specific Months | ⬜ Not Done | | Disable on Specific Years | ⬜ Not Done | | ------------------------------------------------------- | ------------ | | Mark Holidays on Specific Days | ✅ Done | | Mark Holidays on Specific Dates | ⬜ Not Done | | Mark Holidays on Date Ranges | ⬜ Not Done | | ------------------------------------------------------- | ------------ | | Set Current Date Indicator | ✅ Done | | Set Current Date on Input Value | ✅ Done | | ------------------------------------------------------- | ------------ | | Set Date Format - YYYY-MM-DD | ✅ Done | | Set Date Format - YYYY/MM/DD | ✅ Done | | Set Date Format - YYYY.MM.DD | ✅ Done | | Set Date Format - DD-MM-YYYY | ✅ Done | | Set Date Format - DD/MM/YYYY | ✅ Done | | Set Date Format - DD.MM.YYYY | ✅ Done | | ------------------------------------------------------- | ------------ | | Picker Position - Left | ✅ Done | | Picker Position - Center | ✅ Done | | Picker Position - Right | ✅ Done | | ------------------------------------------------------- | ------------ | | Days Format - Full Name (ddd) [Eg. Sunday, आइतबार] | ✅ Done | | Days Format - Short Name (dd) [Eg. Sun, आइत] | ✅ Done | | Days Format - Very Short Name (d) [Eg. S, आ] | ✅ Done | | ------------------------------------------------------- | ------------ | | English Language Support | ✅ Done | | Nepali Language Support | ✅ Done | | ------------------------------------------------------- | ------------ | | Dark Theme | ✅ Done | | ------------------------------------------------------- | ------------ | | Min Date | ⬜ Not Done | | Max Date | ⬜ Not Done |