1.1.2 • Published 4 months ago

ng-asax-jalali-date-range-picker v1.1.2

Weekly downloads
-
License
-
Repository
github
Last release
4 months ago

Angular ASAX Jalali DatePicker

This is a configurable jalali (persian, khorshidi, shamsi) date-picker build for Angular 2 applications and uses jalali-moment as its dependency.

Click to preview a simple Demo

Screenshots

  1. Download from npm: npm install ng-asax-jalali-date-picker
  2. import the NgAsaxJalaliDatepickerModule module in typescript (.ts) or es6 files like below:
    import { NgAsaxJalaliDatepickerModule } from 'ng-asax-jalali-date-range-picker';
  3. Add NgAsaxJalaliDatepickerModule to your module imports:
 @NgModule({
   ...
   imports: [
     ...
     NgAsaxJalaliDatepickerModule
   ]
 })

How to use

<ng-asax-jalali-date-range-picker [toDate]="toDate" [fromDate]="fromDate" [maxDate]="maxDate" [minDate]="minDate" (onChange)="handleChange($event)"></ng-asax-jalali-date-range-picker>
import moment, { Moment } from "jalali-moment";

import { Component } from "@angular/core";

@Component({
  selector: "app-root",
  templateUrl: "./app.component.html",
  styleUrl: "./app.component.scss",
})
export class AppComponent {
  handleChange({ fromDate, toDate }: { fromDate: moment.Moment; toDate: moment.Moment }) {
    this.fromDate = fromDate;
    this.toDate = toDate;
  }

  fromDate: Moment = moment().startOf("jYear");
  minDate: Moment = moment().add(-1, "jYear");
  maxDate: Moment = moment();
  toDate: Moment = moment();
}

How to use the output as a jalali (shamsi) date

import * as moment from 'jalali-moment';
dateObject.format('jYYYY/jMM/jD)'

read jalali-moment

Attributes (Input):

all attributes in the following table could be used as

NameTypeDefaultDescription
fromDateMomentmoment().startOf('year')This is a validation rule, if the selected date will be before minDate the containing form will be invalid. Note: if provided as string format configuration should be provided in the config object.
toDateMomentmoment()This is a validation rule, if the selected date will be before minDate the containing form will be invalid. Note: if provided as string format configuration should be provided in the config object.
minDateMomentmoment().add(-1,'jYear').startOf('year')This is a validation rule, if the selected date will be before minDate the containing form will be invalid. Note: if provided as string format configuration should be provided in the config object.
maxDateMomentmoment()This is a validation rule, if the selected date will be before minDate the containing form will be invalid. Note: if provided as string format configuration should be provided in the config object.

Attributes (Output):

NameEvent ArgumentsApplies ToDescription
onChangeCalendarValueAll PickersThis event will be emitted on every valid value change, if you want to receive every value (valid and invalid) please use the native ngModelChange output.
1.1.1

4 months ago

1.1.0

4 months ago

1.1.2

4 months ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

0.2.19

1 year ago

0.2.18

1 year ago

0.2.17

1 year ago

0.2.15

1 year ago

0.2.14

1 year ago

0.2.13

1 year ago

0.2.12

1 year ago

0.2.11

1 year ago

0.2.10

1 year ago

0.1.0

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.0.10

1 year ago

0.2.1

1 year ago

0.0.3

1 year ago

0.2.0

1 year ago

1.0.11

11 months ago

0.2.7

1 year ago

0.0.9

1 year ago

1.0.10

11 months ago

0.2.6

1 year ago

0.0.8

1 year ago

0.2.9

1 year ago

0.2.8

1 year ago

1.0.15

11 months ago

0.2.3

1 year ago

0.0.5

1 year ago

1.0.14

11 months ago

0.2.2

1 year ago

0.0.4

1 year ago

1.0.13

11 months ago

0.2.5

1 year ago

0.0.7

1 year ago

1.0.12

11 months ago

0.2.4

1 year ago

0.0.6

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago