Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
TwatiSuman committed Jan 5, 2025
1 parent c313243 commit 8147b0c
Show file tree
Hide file tree
Showing 17 changed files with 1,074 additions and 470 deletions.
107 changes: 81 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,101 @@
# Getting Started with Create React App
Here’s the complete `README.md` for your project:

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
````markdown
# BSDatePicker - Nepali & Gregorian Date Picker

## Available Scripts
**Version:** 1.0.0
**Release Date:** January 5, 2025

In the project directory, you can run:
## Overview

### `yarn start`
The BSDatePicker is a robust and user-friendly date picker component supporting both the Nepali (Bikram Sambat) and Gregorian (AD) calendar systems. It offers seamless integration for developers looking to implement dual-language date selection in their applications.

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
## Features

The page will reload if you make edits.\
You will also see any lint errors in the console.
- **Dual Calendar Support**:
Switch effortlessly between Nepali (BS) and Gregorian (AD) calendars.

### `yarn test`
- **Customizable Date Formats**:
Supports popular formats such as `YYYY/MM/DD`, `DD/MM/YYYY`, and `MMMM DD, YYYY`.

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
- **Dynamic Calendar Display**:

### `yarn build`
- Automatic adjustments for months and years across both calendars.
- Cross-calendar date mapping with highlighted selections.

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.
- **Internationalization**:

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!
- Nepali numerals for BS dates.
- English numerals for Gregorian dates.

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
- **Interactive UI**:

### `yarn eject`
- Modern popover-based date picker interface.
- Responsive design with easy navigation.

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
- **Callback Integration**:
Provides selected dates in both calendar formats using an `onDateChange` callback.

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
## Installation

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
Install the package using npm:

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
```bash
npm install bs-datepicker
```
````

## Learn More
## Usage

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
Import and implement the BSDatePicker in your project:

To learn React, check out the [React documentation](https://reactjs.org/).
```typescript
import { BSDatePicker } from "bs-datepicker";

<BSDatePicker
language="np"
format="YYYY-MM-DD"
onDateChange={(date) => console.log(date)}
/>;
```

### Props

| Prop | Type | Default | Description |
| -------------- | -------- | -------------- | -------------------------------------------------------------- |
| `onDateChange` | Function | `undefined` | Callback providing the selected date in both formats. |
| `defaultValue` | String | `undefined` | Initial date value (BS or Gregorian format). |
| `language` | String | `'en'` | Language for the calendar (`np` for Nepali, `en` for English). |
| `format` | String | `'YYYY-MM-DD'` | Date format. |

## Release Notes

### Version 1.0.0

- Initial release of the BSDatePicker component.
- Fully functional support for Nepali and Gregorian calendars.
- Cross-calendar dynamic month/year navigation.
- Customizable date formats and styling.
- Input validation and date range checks.

## Roadmap

- **Range Selection**: Add support for selecting date ranges.
- **Accessibility Improvements**: Enhanced support for screen readers.
- **Custom Themes**: Provide more options for UI customization.

## Support

If you encounter any issues or have suggestions, please reach out to us:

- **Email**: [email protected]
- **GitHub**: [https://github.com/bs-datepicker](https://github.com/bs-datepicker)

---

Thank you for choosing **BSDatePicker**! 🎉

```
Let me know if you'd like further edits or additions!
```
14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
{
"name": "bs-date-picker-react",
"version": "0.1.0",
"private": true,
"private": false,
"dependencies": {
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^13.0.0",
"@testing-library/user-event": "^13.2.1",
"@radix-ui/react-popover": "^1.1.4",
"@types/jest": "^27.0.1",
"@types/node": "^16.7.13",
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"clsx": "^2.1.1",
"lucide-react": "^0.469.0",
"nepali-date-converter": "^3.3.2",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-scripts": "5.0.1",
"typescript": "^4.4.2",
"web-vitals": "^2.1.0"
"tailwind-merge": "^2.6.0",
"tailwindcss": "^3.4.17",
"typescript": "^4.4.2"
},
"scripts": {
"start": "react-scripts start",
Expand Down
4 changes: 2 additions & 2 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"short_name": "BS Date Picker",
"name": "Bikram Sambat date picker react App",
"icons": [
{
"src": "favicon.ico",
Expand Down
38 changes: 0 additions & 38 deletions src/App.css

This file was deleted.

9 changes: 0 additions & 9 deletions src/App.test.tsx

This file was deleted.

26 changes: 0 additions & 26 deletions src/App.tsx

This file was deleted.

Loading

0 comments on commit 8147b0c

Please sign in to comment.