An open API service indexing awesome lists of open source software.

https://github.com/me-majidi/ng-jalali-calendar

:calendar: Angular Jalali Calendar
https://github.com/me-majidi/ng-jalali-calendar

angular angular6 calendar calendar-component jalali-calendar

Last synced: 28 days ago
JSON representation

:calendar: Angular Jalali Calendar

Awesome Lists containing this project

README

        




Ng-Jalali-Calendar


Jalali calendar for Angular4+ applications


## Table of contents
- [Online Demo](https://me-majidi.github.io/ng-jalali-calendar/)
- [Installation](https://www.npmjs.com/package/ng-jalali-calendar#installation)
- [Usage](https://www.npmjs.com/package/ng-jalali-calendar#usage)
- [API](https://www.npmjs.com/package/ng-jalali-calendar#api)
- [Example](https://www.npmjs.com/package/ng-jalali-calendar#example)

## Installation
```shell
npm install --save ng-jalali-calendar
```

## Usage
Import `NgJalaliCalendarModule` in your module

```typescript
import { NgModule } from '@angular/core';
import { NgJalaliCalendarModule } from 'ng-jalali-calendar'

@NgModule({
imports: [ NgJalaliCalendarModule ]
})
export class YourModule { }
```
afterward, add the `ng-jalali-component` tag into the component where you want to use the calendar :
```html

```

## API
**Inputs:**

Input | Type | Description
--- | --- | ---
selectedDates | String[] | dates that you want to be selected on the calendar

**Events:**

| Output | $event | Description |
| --- | ---- | --- |
| dateSelected | String | emitted when selecting a date |

> the module works with dates in `YYYY/MM/DD` format
## Example
```typescript
import { Component, OnInit } from '@angular/core';


@Component({
selector : 'app-example',
templateUrl: './example.component.html',
styleUrls : [ './example.component.css' ]
})
export class ExampleComponent implements OnInit {
selectedDate: string = '';
selectedDates: string[] = [
'1397/5/22',
'1397/12/1'
'1397/01/5'
];

constructor () {}

ngOnInit () {
}

onSelectDate(event: string) {
this.selectedDate = event;
}
}
```

```html

```