withDay method

  1. @override
Jalali withDay(
  1. int day
)
override

Make a new date object with changed day

Original date object remains unchanged

This method is NOT safe

Throws DateException on problems

Note: For changing at once use copy() methods

Note: You can chain methods

Implementation

@override
Jalali withDay(int day) {
  if (day == this.day) {
    return this;
  } else {
    return Jalali(
      year,
      month,
      day,
      hour,
      minute,
      second,
      millisecond,
    );
  }
}