PersianDate.fromGregorian constructor

PersianDate.fromGregorian(
  1. int year,
  2. int month,
  3. int day
)

Creates a date from a Gregorian year, month, and day.

Out-of-range values roll over like DateTime, so PersianDate.fromGregorian(2021, 2, 30) is the same day as 2021-03-02.

Implementation

factory PersianDate.fromGregorian(int year, int month, int day) =>
    PersianDate.fromDateTime(DateTime(year, month, day));