npm package: @jboothwebdev/simple-date-picker
Description: # Status  **currently in beta** App functions but is not the prettiest and  # Installation To install this module use  ``` bash npm install @jboothwebdev/simple-date-picker ```    or ``` bash yarn add @jboothwebdev/simple-date-picker ```
Latest version: 0.2.6

# 

# Status 
**currently in beta**
App functions but is not the prettiest and 
# Installation
To install this module use 
``` bash
npm install @jboothwebdev/simple-date-picker
```
   or
``` bash
yarn add @jboothwebdev/simple-date-picker
```

## Description
 A simple to implement and use date picker that allows users to selection a single date. To create a range just use two the of the **DatePickers**
 

## Source
[source code](https://gitlab.com/jboothwebdev1/simple-date-picker)


## Client Use
Date picker will create a input style box with the title and a calendar icon. Clicking on the box will cause a modal to open with a day, month, and year picker. Clicking on the text of any of the options will cause another menu to open with either the days of the month, the months or years within a 50 year range.
Users do have to hit the submit button in order for the date to save and be return through the callback function


## To use 
#### First import the DatePicker into your component.
``` javascript 
import {DatePicker} from "@jboothwebdev/simple-date-picker";
```

#### Second create the callback function to use the Date
  The **DatePicker** will return a Standard JS Date time object. 
   - i.e. Wed Jul 27 2022 13:27:43 GMT-0600 (Mountain Daylight Time)

#### Third Add the component to the application 

``` javascript
import {useState} from "react";
import {DatePicker} from "@jboothwebdev/simple-date-picker";


const App = () => { 
  // Recommended set up is to use a useState
  const [date, setDate] = useState();
  
  return (
    <>
      // Then when we create the DatePicker we have to pass in two props
      <DatePicker callback={(date) => {setDate(date)}} theme={"light"} />
    </>
    )
}

```

``` javascript
// Or you can use any function that that just takes a date as the parameter
<DatePicker callback={(date) => {yourFunction(date)}} theme={"light"} />
```

## Parameters
Currently there are only two parameters and they are both required 

#### callback 
The callback parameter is used by the date picker to return the date and will be called by the submit button in the picker. The picker is automatically loaded with the current date so if nothing in the form is changed then it will automatically return todays date. 

#### theme 
The theme parameter must be passed a string that matches a built in theme.
and changes to styling that are not build into a theme must be done through className overrides.

#### Currently Availble Themes 

#### theme={"light"}
- grayscale theme background is light and text is dark. 

[light main element](https://drive.google.com/file/d/1hyBfUq3Ti744RhqaEqWOLBZfkqr_9rJR/view?usp=sharing)

[light selection fields](https://drive.google.com/file/d/1KP4Ve86NQ2Bbyh78CVlJH5vjE4UK-q7X/view?usp=sharing)

#### theme={"dark"}
- grayscale theme background is dark and the test is light.

[Dark main element](https://drive.google.com/file/d/1maK9THQEcPqrFcI6aIyLVMc6mKudhYDH/view?usp=sharing)

[Dark selection fields](https://drive.google.com/file/d/1g7rA6p1NGs9L-Y6-ikw2QnnwgzJXSPg2/view?usp=sharing)

[Dark sub menu](https://drive.google.com/file/d/1YrmH-D8EUAlxtjEKuUQYDe6GcmpWde_l/view?usp=sharing)

#### theme={"teal-light"}
- adds teal accents to the light theme

#### theme={"teal-dark"}
- adds teal accents to the dark theme


#### theme={"purple-light"}
- adds purple accents to the light theme

#### theme={"purple-dark"}
- adds purple accents to the dark theme
 
## Change Log 
- Version 0.2.6
  - added two new themes 
    - purple
    - teal
  - updated documentation
  - added documentation

- Version 0.2.5
  - Made the text in the main box clickable to open the selection area.

## Future Plans 
- Make the initial box editable 
  - Don't think this is going to happen but made it clickable.
- Add more themes

## Support 
If you like the component and want to help with keeping it maintained you can drop a donation through 
Cashapp at **$jdbooth9516**.

Please limit donations to under 5$

## Issues and Ideas 
If you have an issue or have a idea for a feature craete an issue on the gitlab project.