Test

Debug Output: Hijri full years to days: 512059 days (including 529 leap days) Hijri full months to days: 512207 days Length of current Hijri month: 29 days Total days since Hijri epoch: 512213 days

Destination year: 2024, Destination month: 12, Destination date: 7

Example 0: Hijri to Gregorian

Parameters:

  • Origin_Calendar = Hijri
  • Destination_Calendar = Gregorian
  • Origin_Year = 1446
  • Origin_Month = 7
  • Origin_Date = 7

Template Call: Debug Output: Hijri full years to days: 512059 days (including 529 leap days) Hijri full months to days: 512236 days Length of current Hijri month: 30 days Total days since Hijri epoch: 512242 days

Destination year: 2025, Destination month: 1, Destination date: 5

Expected Result:

  • Destination year: 2025
  • Destination month: 1
  • Destination date: 7
  • Destination day: Tuesday

Example 1: Hijri to Gregorian

Parameters:

  • Origin_Calendar = Hijri
  • Destination_Calendar = Gregorian
  • Origin_Year = 1445
  • Origin_Month = 4
  • Origin_Date = 10

Template Call: Debug Output: Hijri full years to days: 511705 days (including 529 leap days) Hijri full months to days: 511794 days Length of current Hijri month: 29 days Total days since Hijri epoch: 511803 days

Destination year: 2023, Destination month: 10, Destination date: 24

Expected Result:

  • Destination year: 2024
  • Destination month: 2
  • Destination date: 10
  • Destination day: Sunday

Example 2: Gregorian to Hijri

Parameters:

  • Origin_Calendar = Gregorian
  • Destination_Calendar = Hijri
  • Origin_Year = 2024
  • Origin_Month = 2
  • Origin_Date = 10

Template Call: Debug Output: Gregorian to JDN: 2460351 Calculated JDN: 2460351 Hijri date -> Year: 1445, Month: 8, Day: 1

Destination year: 1445, Destination month: 8, Destination date: 1

Expected Result:

  • Destination year: 1445
  • Destination month: 4
  • Destination date: 10
  • Destination day: N/A

Example 3: Hijri to Gregorian

Parameters:

  • Origin_Calendar = Hijri
  • Destination_Calendar = Gregorian
  • Origin_Year = 1400
  • Origin_Month = 1
  • Origin_Date = 1

Template Call: Debug Output: Hijri full years to days: 495758 days (including 512 leap days) Hijri full months to days: 495758 days Length of current Hijri month: 30 days Total days since Hijri epoch: 495758 days

Destination year: 1979, Destination month: 11, Destination date: 19

Expected Result:

  • Destination year: 1979
  • Destination month: 10
  • Destination date: 20
  • Destination day: Saturday

Example 4: Gregorian to Hijri

Parameters:

  • Origin_Calendar = Gregorian
  • Destination_Calendar = Hijri
  • Origin_Year = 2000
  • Origin_Month = 1
  • Origin_Date = 1

Template Call: Debug Output: Gregorian to JDN: 2451547 Calculated JDN: 2451547 Hijri date -> Year: 1420, Month: 9, Day: 27

Destination year: 1420, Destination month: 9, Destination date: 27

Expected Result:

  • Destination year: 1420
  • Destination month: 9
  • Destination date: 23
  • Destination day: N/A

Example 5: Invalid Input

Parameters:

  • Origin_Calendar = Hijri
  • Destination_Calendar = Gregorian
  • Origin_Year =
  • Origin_Month =
  • Origin_Date =

Template Call: خطأ لوا في وحدة:CalendarConversion على السطر 17: attempt to perform arithmetic on local 'year' (a nil value).

Expected Result: Invalid parameters: please provide all required inputs.

Example 6: Conversion Not Supported

Parameters:

  • Origin_Calendar = Coptic
  • Destination_Calendar = Farsi
  • Origin_Year = 1738
  • Origin_Month = 5
  • Origin_Date = 20

Template Call: Conversion not supported.

Expected Result: Conversion not supported yet for these calendars.