UNPKG

nepali-patro-datepicker-react

Version:
52 lines (34 loc) 1.17 kB
# Nepali Patro Datepicker React A lightweight and customizable Nepali (Bikram Sambat) datepicker component built for React. ## 📦 Installation Install the package using npm or yarn: ```bash npm install nepali-patro-datepicker-react ``` ## Usage Here's a basic example of how to use the date-picker-np in your React project: ```jsx import React, { useState } from "react"; import { Datepicker } from "nepali-patro-datepicker-react"; import "nepali-patro-datepicker-react/style.css"; const App = () => { const [selectedDate, setSelectedDate] = useState("2082-4-6"); return ( <Datepicker value={selectedDate} onChange={(date) => setSelectedDate(date)} /> ); }; export default App; ``` **Parameters:** - `date: string` — A date string in `YYYY-MM-DD` format. **Returns:** - `string` — The equivalent BS date in `YYYY-MM-DD` format. ## Supported Nepali Date Range The date picker supports selecting dates within the range: - **Minimum Date**: `2000-01-01` - **Maximum Date**: `2099-12-31` ## License MIT © [https://github.com/ShlokShrestha](https://github.com/ShlokShrestha)