3.0.6 • Published 2 years ago

akbari-date-picker v3.0.6

Weekly downloads
78
License
-
Repository
-
Last release
2 years ago

AkbariDatePicker

this is a fantastic persion datepicker and jalali datepicker for angular 9 . added responsive pretty mode. fix 31 days in first 6 month.

Demo

desktop mode

demo

responsive mode

demo

install

Run npm i akbari-date-picker

add Library to app.module.ts

import { AkbariDatePickerModule } from 'akbari-date-picker';/// add this line 
import { FormsModule } from '@angular/forms';/// add this line 

and import

imports: [
    BrowserModule,
    FormsModule,/// add this line 
    AkbariDatePickerModule,  /// and  add this line 
    AppRoutingModule,
  ],

full example of add to app.module.ts

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { FormsModule } from '@angular/forms';/// add this line 
import { AkbariDatePickerModule } from 'akbari-date-picker'; ///add this line 

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    FormsModule,/// add this line 
    AkbariDatePickerModule,  /// and  add this line 
    AppRoutingModule,
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

how to use => you can use angular ngModel to get datepicker value.

<akbari-date-picker  [(ngModel)]="date" ></akbari-date-picker>

inputs

inputtypedefault
datestringsystem current date to persian
minDatestring30 years old
maxDatestring30 years later
widthstring'300px'
placeHolderstring''
mobileModebooleanfalse

output

onChangeDate | function | null

Inputs

minDate => type ="string"

you can pass type string format;

example

<akbari-date-picker [minDate]="'1300/9/8'" ></akbari-date-picker>

or 

<akbari-date-picker minDate="1300/9/8"  ></akbari-date-picker>

maxDate => type ="string"

you can pass type string format;

example

<akbari-date-picker [maxDate]="'1300/9/8'" ></akbari-date-picker>

or 

<akbari-date-picker maxDate="1300/9/8"  ></akbari-date-picker>

date => type ="string" => default date

you can pass type string format;

example

<akbari-date-picker [date]="'1300/9/8'" ></akbari-date-picker>

or 

<akbari-date-picker date="1300/9/8"  ></akbari-date-picker>

width => type ="string"

you can pass type string format;

example

<akbari-date-picker width="350px" ></akbari-date-picker>

placeHolder => type ="string"

you can pass type string format;

example

<akbari-date-picker placeHolder="fromDate" ></akbari-date-picker>

mobileMode => type ="boolean"

you can pass type boolean format;

example

<akbari-date-picker mobileMode="true" ></akbari-date-picker>

Output

onChangeDate => when user select date this output emit.

in html

<akbari-date-picker (onChangeDate)="onChangeDate($event)" ></akbari-date-picker>

in .ts

onChangeDate(event){
    alert(event)
 }

validation

in html

  <akbari-date-picker  
   required 
   #datepickers="ngModel"
   name="test" 
   (onChangeDate)="onChangeDate($event)" 
   [(ngModel)]="test" 
   style="margin-left: 50px;"
   >
   </akbari-date-picker>

  <div *ngIf="datepickers.invalid && (datepickers.touched || datepickers.dirty)">datepicker has error  </div>

finall

hope to enjoy it .

3.0.4

2 years ago

3.0.6

2 years ago

3.0.5

2 years ago

3.0.3

3 years ago

3.0.2

3 years ago

3.0.1

3 years ago

2.1.3

3 years ago

2.1.2

3 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.1.0

3 years ago

2.0.1

4 years ago

1.0.9

4 years ago

2.0.0

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago