Skip to content

Commit

Permalink
✨ features: Mega Update
Browse files Browse the repository at this point in the history
- Bundle plugin to one js file.
- Separate js and css file build.
- Update Readme with new installation.
- Remove unnecessary access to Class methods and variable.
- Bug Fixes.
  • Loading branch information
anuzpandey committed Nov 3, 2023
1 parent d186e6f commit 7dbb9a8
Show file tree
Hide file tree
Showing 12 changed files with 325 additions and 309 deletions.
59 changes: 36 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,45 @@
### Nepali Date Picker
![branding-image.png](dist%2Fimg%2Fbranding-image.png)
# Nepali Date Picker
Lightweight, Powerful JavaScript Nepali Date Picker with no dependencies.

### INSTALLATION
![branding-image.png](public%2Fimg%2Fbranding-image.png)

- Add nepali-date-picker.min.js
- Add nepali-date-picker.min.css
## INSTALLATION

### USAGE
### 1. Download the latest release
[Download](https://github.com/anuzpandey/nepali-date-picker/releases/latest) and extract the zip file and copy the files from `dist` folder to your project.

### 2. Use a standalone build
```html
<!-- Add to the head section -->
<link rel="stylesheet" href="./css/nepali-date-picker.min.css">
<!-- Add to the end of body section -->
<script src="dist/nepali-date-picker.bundle.js"></script>
```
#### OR

<!-- Add data-nepali-date-picker="unique_value" attribute to input field -->
<input type="text" readonly data-nepali-date-picker="date_of_birth" placeholder="YYYY-MM-DD">
### 3. Use separate files (JS and CSS)
```html
<!-- Add to the head section -->
<link rel="stylesheet" href="dist/nepali-date-picker.min.css">

<!-- Add to the end of body section -->
<script src="js/nepali-date-picker.min.js"></script>
<script src="dist/nepali-date-picker.min.js"></script>
```

---

<script>
// Initialize Nepali Date Picker
new NepaliDatePicker()
</script>
### USAGE
```javascript
// Initialize Nepali Date Picker
new NepaliDatePicker('.date-picker')
// --- OR ---
new NepaliDatePicker('#date-of-birth')
// --- OR ---
new NepaliDatePicker('selector', config) // See Config Options below
```

---

#### Config Options

```javascript
let config = {
format: 'YYYY-MM-DD', // 'YYYY-MM-DD', 'YYYY/MM/DD', 'YYYY.MM.DD', 'DD-MM-YYYY', 'DD/MM/YYYY', 'DD.MM.YYYY'
Expand All @@ -47,16 +63,12 @@ let config = {

```javascript
// To Convert English Date to Nepali Date
let NepaliDatePicker = new NepaliDatePicker();
NepaliDatePicker.convertToNepaliDate(2053, 1, 10)
NepaliDatePicker.convertToNepaliDate(1996, 4, 22)
// Result: {year: 2053, month: 1, day: 10}
```

#### Features

- [x] ~~Proper UI for Date Picker~~
- [x] ~~Convert English Date to Nepali Date~~
- [ ] Convert Nepali Date to English Date
Expand All @@ -67,8 +79,9 @@ NepaliDatePicker.convertToNepaliDate(2053, 1, 10)
- [ ] Add Configurations to Date Picker
- [x] ~~Close/Hide Date Picker on Date Select~~
- [ ] Disable features on
- [ ] Today's Date
- [ ] Before Today's Date
- [x] Today's Date
- [x] Before Today's Date
- [x] Before After Today's Date
- [ ] Specific Dates
- [ ] Specific Days
- [ ] Specific Months
Expand Down Expand Up @@ -97,7 +110,7 @@ NepaliDatePicker.convertToNepaliDate(2053, 1, 10)
- [x] ~~Language Support (np/en)~~
- [x] ~~English~~
- [x] ~~Nepali~~
- [x] ~~Date Picker Theme~~
- [ ] Date Picker Theme
- [x] ~~Light~~
- [x] ~~Dark~~
- [ ] Min Date
Expand Down
1 change: 0 additions & 1 deletion dist/css/nepali-date-picker.min.css

This file was deleted.

Binary file removed dist/favicon.ico
Binary file not shown.
Loading

0 comments on commit 7dbb9a8

Please sign in to comment.