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

nepali-date-utility

v1.6.0

Published

A beautiful React date picker component with other date utilities for Nepali Bikram Sambat calendar

Readme

🌸 Nepali DatePicker

A beautiful and customizable React date picker component along with other utilities for the Nepali Bikram Sambat calendar system.

Live Demo »

✨ Features

  • 🌿 Modern, clean UI with Tailwind CSS
  • 📅 Full support for the Bikram Sambat calendar
  • 🔁 Seamless BS ↔ AD conversion utilities
  • 🌐 Localization (English + Nepali)
  • 🎨 Highly customizable theming
  • 📱 Responsive and accessible design
  • 🧠 Simple and powerful API

📦 Installation

npm install nepali-date-utility

🚀 Usage

In tailwind.config.js, add "./node_modules/nepali-date-utlity/**/*.{js,ts,jsx,tsx}"

// tailwind.config.js

...
content: [
    "./src/**/*.{js,ts,jsx,tsx}",
    "./node_modules/nepali-date-utility/**/*.{js,ts,jsx,tsx}"
],
...

Or if you are working in vite app, then in your main styleshteet add the following:

@source "../node_modules/nepali-date-utility";
import React, { useState } from "react";
import {
  NepaliDatePicker,
  CustomDate,
  formatDate,
  convertBSToAD,
} from "nepali-date-utility";

function App() {
  const [selectedDate, setSelectedDate] = useState<CustomDate | null>(null);

  const handleDateChange = (date: CustomDate) => {
    setSelectedDate(date);
    console.log("Selected date:", date);
    console.log("Formatted date:", formatDate(date));
    console.log("Converted date:", formatDate(convertBSToAD(date)));
  };

  return (
    <div className="p-4">
      <h1 className="text-xl font-bold mb-4">Nepali Date Utility Demo</h1>

      <NepaliDatePicker
        value={selectedDate}
        onChange={handleDateChange}
        placeholder="Select Nepali Date"
      />

      {selectedDate && (
        <p className="mt-4">Selected: {formatDate(selectedDate)}</p>
      )}
    </div>
  );
}

export default App;

🧾 API Reference

NepaliDatePicker Props

| Prop | Type | Default | Description | | ---------------------- | ----------------------------- | -------------------------- | --------------------------------------------------------------- | | value | CustomDate \| null | null | Selected date | | onChange | (date: CustomDate) => void | - | Callback when date changes | | placeholder | string | "YYYY-MM-DD" | Placeholder text for input | | disabled | boolean | false | Disable the datepicker | | minDate | CustomDate | - | Min date (inclusive) | | maxDate | CustomDate | - | Max date (inclusive) | | formatOptions | CustomDateFormatOptions | { format: "YYYY-MM-DD" } | Format options for date display | | className | string | - | Additional class name for the widget (mainly used for w-full) | | inputClassName | string | - | Override class name for input field | | calendarClassName | string | - | Override class name for calendar popup | | dayClassName | string | - | Override class name for the days in calendar | | selectedDayClassName | string | - | Override class name for the selected day in calendar popup | | todayClassName | string | - | Override class name for the today date in calendar popup | | disabledDayClassName | string | - | Override class name for the disabled day in calendar popup | | position | "bottom" \| "top" \| "auto" | "bottom" | Position of the calendar popup |

🧱 Type Definitions

interface CustomDate {
  year: number;
  month: number;
  day: number;
}

interface CustomDateFormatOptions {
  format?: "YYYY-MM-DD" | "DD-MM-YYYY" | "MM/DD/YYYY" | "YYYY/MM/DD" | string;
  locale?: "en" | "ne";
  separator?: string;
}

🔧 Utility Functions

  • convertADToBS(adDate: Date): CustomDate - Convert AD date to BS date
  • convertBSToAD(bsDate: CustomDate): CustomDate - Convert BS date to AD date
  • getTodayBS(): NepaliDate - Get today's date in BS
  • formatDate(date: CustomDate, options?: CustomDateFormatOptions): string - Format customDate type to string
  • parseDate(dateStr: string, format?: string): CustomDate | null - Parse string to CustomDate format
  • isValidBsDate(date: NepaliDate): boolean - Check if BS date is valid

🎨 Customization Examples

You can customize the appearance using Tailwind classes:

<NepaliDatePicker
  value={getTodayBS()}
  inputClassName="text-red-500 bg-purple-50 border-2 border-indigo-500 focus:outline-none focus:ring-1 ring-indigo-500"
  calendarClassName="text-blue-500 border-2 border-red-500"
  dayClassName="text-blue-500"
  selectedDayClassName="bg-red-500 text-white hover:bg-red-500"
  todayClassName="border-red-500 border-2"
  placeholder="Custom Input Style"
  disabledDayClassName="opacity-20"
/>
<NepaliDatePicker
  value={null}
  minDate={{ year: 2080, month: 1, day: 1 }}
  maxDate={{ year: 2080, month: 12, day: 30 }}
  placeholder="2080 BS only"
/>
<NepaliDatePicker value={null} disabled={true} placeholder="This is disabled" />
<NepaliDatePicker
  value={null}
  position="top"
  placeholder="Calendar opens above"
/>

🌐 Demo

📍 Live Preview: https://date.aryalabhinaya.com.np

Explore the component’s features interactively.

📄 License

MIT