app/Date/AbstractCalendarDate.php
public function convertToCalendar(string $calendar): AbstractCalendarDate
    {
        switch ($calendar) {
            case 'gregorian':
                return new GregorianDate($this);
            case 'julian':
                return new JulianDate($this);
            case 'jewish':
                return new JewishDate($this);
            case 'french':
                return new FrenchDate($this);
            case 'hijri':
                return new HijriDate($this);
            case 'jalali':
                return new JalaliDate($this);
            default:
                return $this;
        }
    }
public function convertToCalendar(string $calendar): AbstractCalendarDate
    {
        switch ($calendar) {
            case 'gregorian':
                return new GregorianDate($this);
            case 'julian':
                return new JulianDate($this);
            case 'jewish':
                return new JewishDate($this);
            case 'french':
                return new FrenchDate($this);
            case 'hijri':
                return new HijriDate($this);
            case 'jalali':
                return new JalaliDate($this);
            default:
                return $this;
        }
    }
public function convertToCalendar ( string $ calendar ) : AbstractCalendarDate { switch ( $ calendar ) { case 'gregorian' : return new GregorianDate ( $ this ) ; case 'julian' : return new JulianDate ( $ this ) ; case 'jewish' : return new JewishDate ( $ this ) ; case 'french' : return new FrenchDate ( $ this ) ; case 'hijri' : return new HijriDate ( $ this ) ; case 'jalali' : return new JalaliDate ( $ this ) ; default : return $ this ; } }
Convert a date from one calendar to another.

@param string $calendar

@return AbstractCalendarDate
Convert a date from one calendar to another .