SaeedDev94 / ng-persian-datepicker

Persian datepicker for angular 17+
MIT License
86 stars 19 forks source link

Gregorian value #12

Closed mehdizz closed 2 years ago

mehdizz commented 3 years ago

Hi this [dateIsGregorian]="true" does not work?! and this [dateValue]="number" does not work?!

https://stackblitz.com/edit/angular-ivy-xemyac?file=src%2Fapp%2Fapp.component.html

SaeedDev94 commented 3 years ago

Hi, The [dateIsGregorian] boolean option simply means [dateValue] you passed to <ng-persian-datepicker /> is gregorian or not ng-persian-datepicker isn't for choosing gregorian date Example:

<input type="text" #datepickerInput />
<ng-persian-datepicker
  [input]="datepickerInput"
  [dateValue]="'1994-05-23 16:00:00'"
  [dateIsGregorian]="true"
  [timeMeridian]="true"></ng-persian-datepicker>

If you want pass timestamp to [dateValue] then [dateIsGregorian] is useless:

<input type="text" #datepickerInput />
<ng-persian-datepicker
  [input]="datepickerInput"
  [dateValue]="769692600000"
  [timeMeridian]="true"></ng-persian-datepicker>