# react-nepali-calendar

> React Component for Nepali BS Calendar

Latest version **1.1.5** (published 2018-07-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-nepali-calendar
pnpm add react-nepali-calendar
yarn add react-nepali-calendar
bun add react-nepali-calendar
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.5 |
| Published | 2018-07-20 |
| First published | 2018-07-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 27.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Asish Bhattarai |
| Maintainers | getaasciesh |

## Links

- npm: https://www.npmjs.com/package/react-nepali-calendar
- Repository: https://github.com/getaasciesh/React-Nepali-Calendar
- Issues: https://github.com/getaasciesh/React-Nepali-Calendar/issues
- npm.io page: https://npm.io/package/react-nepali-calendar

## Dependencies (3)

- [react](https://npm.io/package/react.md) ^16.4.1
- [react-dom](https://npm.io/package/react-dom.md) ^16.4.1
- [react-jss](https://npm.io/package/react-jss.md) ^8.6.1

## Recent versions

- 1.1.5 (latest) — 2018-07-20
- 1.1.4 — 2018-07-19
- 1.1.3 — 2018-07-17
- 1.1.2 — 2018-07-17
- 1.1.1 — 2018-07-08
- 1.1.0 — 2018-07-08
- 1.0.2 — 2018-07-08
- 1.0.1 — 2018-07-08
- 1.0.0 — 2018-07-08

## README

## Intro
Simple React Nepali BS Calendar component with couple of handy BS-AD coverter functions.

[Click here for demo implementation!](https://codesandbox.io/s/l2y030r8zm "click it to see the component it in action")

<a href="https://l2y030r8zm.codesandbox.io/" target="_blank">
<img src="https://raw.githubusercontent.com/getaasciesh/ReactNepaliCalendar/master/screenshot.png" />
</a>

## Installation

```
yarn add react-nepali-calendar
```
or
```
npm install --save react-nepali-calendar
```

## Usage

```
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import Calendar from 'react-nepali-calendar';

export default class Main extends React.Component {
  render() {
    return (
      <Calendar onChange={(date) => console.log('New date selected: ', date)}/>
    );
  }
}
```
##### Props for Calendar component
* defaultDate?: Date //optional. default selected date on calendar. applied only once at component mount
* onChange?: (date: Date) => void; // optional. fired when a date is selected in the calendar.
* className?: string // className for the wrapper div

### Calendar Methods
#### convert AD To BS: CalendarFunctions.convertADtoBS(adYear, adMonth: 1..12, adDate) 
```
import { CalendarFunctions } from 'react-nepali-calendar';

const bsDate = CalendarFunctions.convertADtoBS(2018, 9, 10);
// bsDate == { "bsDate": 25, "bsMonth": 5, "bsYear": 2075 }
```

#### convert BS to AD
```
import { CalendarFunctions } from 'react-nepali-calendar';

const adDate = CalendarFunctions.convertBStoAD(2076, 2, 29);
// adDate == new Date(2019, 5, 12)
```

## Testing
To test clone the repo and run:
```
npm test
```

## License
React Nepali Calendar is released under the MIT license.

---
_Source: https://npm.io/package/react-nepali-calendar · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
