nepali-date-react

1.0.2 • Public • Published

What This package Does?

  1. Provides Nepali Date Picker
  2. Provides Nepali Date in string format.
  3. Converts Nepali Date to equivalent english date.
  4. Provides English Date in string format

How to use?

You can use them simply by importing functions and components.

import { NepaliDate, EnglishDate } from 'nepali-date-react';
import { Datepicker } from 'nepali-date-react/dist/Datepicker';

Must Wrap dateProvider on the parent component eg: app.js

import { DateProvider } from 'nepali-date-react/contexts/dateContext';

function MyComp() {

  return (
    <div className="mycomp">
      <DateProvider>
        <Your Components Here/>
      </DateProvider>
    </div>
  );
}

export default MyComp;


Your Component

import React from 'react'
import { NepaliDate, EnglishDate } from 'nepali-date-react';
import { Datepicker } from 'nepali-date-react/dist/Datepicker';


export default function Mycomponent() {
    let nepalidate = NepaliDate();
    let englishdate = EnglishDate();
    console.log(nepalidate,englishdate);

    return (
        <div>
        <Datepicker/>
        </div>
    )
}

css hint

.date-picker-container {
    position: relative;
    width:270px;
    height:auto;
}

Screenshot

DatePicker Image

Package Sidebar

Install

npm i nepali-date-react

Weekly Downloads

2

Version

1.0.2

License

ISC

Unpacked Size

31.3 kB

Total Files

9

Last publish

Collaborators

  • ayushthapa