# sanjab-persian-date-picker

> Persian date picker for laravel sanjab (https://github.com/sanjabteam/sanjab)

Latest version **0.1.2** (published 2020-05-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install sanjab-persian-date-picker
pnpm add sanjab-persian-date-picker
yarn add sanjab-persian-date-picker
bun add sanjab-persian-date-picker
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2020-05-26 |
| First published | 2019-08-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Amir Alizadeh |
| Maintainers | amir9480 |

## Links

- npm: https://www.npmjs.com/package/sanjab-persian-date-picker
- Repository: https://github.com/sanjabteam/sanjab-persian-date-picker
- Homepage: https://github.com/sanjabteam/sanjab-persian-date-picker#readme
- Issues: https://github.com/sanjabteam/sanjab-persian-date-picker/issues
- npm.io page: https://npm.io/package/sanjab-persian-date-picker

## Dependencies (1)

- [vue-persian-datetime-picker](https://npm.io/package/vue-persian-datetime-picker.md) 2.1.5

## Recent versions

- 0.1.2 (latest) — 2020-05-26
- 0.1.1 — 2020-05-05
- 0.1.0 — 2020-03-31
- 0.0.6 — 2019-10-24
- 0.0.5 — 2019-10-24
- 0.0.4 — 2019-10-02
- 0.0.3 — 2019-08-28
- 0.0.2 — 2019-08-21

## README

# Persian Date Picker for [Sanjab](https://github.com/sanjabteam/sanjab)

## Installation

Before start make sure you know how [laravel mix](http://laravel.com/docs/mix) works!

---

Install npm packages including laravel mix.

```bash
npm install
```

---

Install the sanjab npm package.

```bash
npm install sanjab --save-dev
```

---

Install sanjab Persian Date picker via npm.
```bash
npm install sanjab-persian-date-picker --save-dev
```

> You should install the same version of the composer package if you don't have latest version.

```bash
npm install sanjab@VERSION --save-dev
```
---

Install sanjab Persian Date picker via composer.

```bash
composer require sanjabteam/sanjab-persian-date-picker
```

---

Create sanjab JS for [custom compile](https://sanjabteam.github.io/compile.html) if not created before.

`resources/js/sanjab.js`:
```js
require('sanjab');

Vue.use(require('sanjab-persian-date-picker').default); // Add this to support persian date picker

if (document.querySelector('#sanjab_app')) {
    window.sanjabApp = new Vue({
        el: '#sanjab_app',
    });
}
```

---

add js file to `webpack.mix.js` for compile.
```js
mix.js('resources/js/sanjab.js', 'public/vendor/sanjab/js')
```

---

Compile and you are ready.

```bash
npm run prod
```

## Usage

```php
use SanjabPersianDatePicker\PersianDatePickerWidget;

// Date only
$this->widgets[] = PersianDatePickerWidget::create('birth_date')
    ->rules('jdate_before:'.verta()->formatDate())
    ->required();

// Date and time
$this->widgets[] = PersianDatePickerWidget::create('released_at')
    ->rules('jdate_before:'.verta()->formatDate())
    ->required()
    ->time(true);
```


## Credits
- [Verta](https://github.com/hekmatinasser/verta)
- [vue-persian-datetime-picker](https://github.com/talkhabi/vue-persian-datetime-picker)

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

---
_Source: https://npm.io/package/sanjab-persian-date-picker · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
