Nimble Polyglot Microcosm

    react-np-datepicker

    0.1.7 • Public • Published

    React Nepali Datepicker

    Integrate Nepali Datepicker in your React app easily.

    Installation

    • Install by executing npm i react-np-datepicker or yarn add react-np-datepicker.
    • Import by adding import { NepaliDatePicker } from 'react-np-datepicker'.

    Demo Link

    https://codesandbox.io/s/nepali-date-picker-0f3d1

    Props

    Common props you may want to specify include:

    • className - apply a className to the control
    • classNameInput - apply classNames to input field
    • name - generate an HTML input with this name, containing the current value
    • onChange - change events
    • placeholder - change the text displayed when no date is defined
    • value - control the current value
    • format - change the date format i.e.('YYYY-MM-DD' && 'YYYY/MM/DD') only

    Usage

    Here's an example of basic usage:

    import React, { useState } from 'react';
    import { NepaliDatePicker, BSDate } from 'react-np-datepicker';
    
    const now = new BSDate.now();
    
    function MyApp() {
      const [date, setDate] = useState(now);
    
      const handleDate = date => {
        setDate(date);
        console.log('Date',date);
      }
    
      return (
            <NepaliDatePicker
                value={date}
                format="YYYY-MM-DD"
                onChange={handleDate}
            />
      );
    }

    Install

    npm i react-np-datepicker

    DownloadsWeekly Downloads

    2

    Version

    0.1.7

    License

    MIT

    Unpacked Size

    49.4 kB

    Total Files

    12

    Last publish

    Collaborators

    • ms13suz