@@ -132,23 +132,23 @@ |
||
| 132 | 132 | |
| 133 | 133 | switch ( $this->type ) { |
| 134 | 134 | |
| 135 | - case 'gregorian': |
|
| 135 | + case 'gregorian': |
|
| 136 | 136 | |
| 137 | - $this->result = $this->gregorinLeapYear(); |
|
| 137 | + $this->result = $this->gregorinLeapYear(); |
|
| 138 | 138 | |
| 139 | - break; |
|
| 139 | + break; |
|
| 140 | 140 | |
| 141 | - case 'jalali': |
|
| 141 | + case 'jalali': |
|
| 142 | 142 | |
| 143 | - $this->result = $this->jalaliLeapYear(); |
|
| 143 | + $this->result = $this->jalaliLeapYear(); |
|
| 144 | 144 | |
| 145 | - break; |
|
| 145 | + break; |
|
| 146 | 146 | |
| 147 | - case 'hijri': |
|
| 147 | + case 'hijri': |
|
| 148 | 148 | |
| 149 | - $this->result = $this->hijriLeapYear(); |
|
| 149 | + $this->result = $this->hijriLeapYear(); |
|
| 150 | 150 | |
| 151 | - break; |
|
| 151 | + break; |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | return $this->result; |
@@ -113,39 +113,39 @@ |
||
| 113 | 113 | |
| 114 | 114 | switch( Datium::$call_type ) { |
| 115 | 115 | |
| 116 | - case 'now': |
|
| 116 | + case 'now': |
|
| 117 | 117 | |
| 118 | - $this->date_time = new DateTime('now'); |
|
| 118 | + $this->date_time = new DateTime('now'); |
|
| 119 | 119 | |
| 120 | - $this->gregorian_DayofWeek = $this->date_time->format('w'); |
|
| 120 | + $this->gregorian_DayofWeek = $this->date_time->format('w'); |
|
| 121 | 121 | |
| 122 | - break; |
|
| 122 | + break; |
|
| 123 | 123 | |
| 124 | - case 'make': |
|
| 124 | + case 'make': |
|
| 125 | 125 | |
| 126 | - $this->date_time = new DateTime('now'); |
|
| 126 | + $this->date_time = new DateTime('now'); |
|
| 127 | 127 | |
| 128 | - $this->date_time->setDate( |
|
| 129 | - self::$array_date[ 'year' ], |
|
| 130 | - self::$array_date[ 'month' ], |
|
| 131 | - self::$array_date[ 'day' ] |
|
| 132 | - ); |
|
| 128 | + $this->date_time->setDate( |
|
| 129 | + self::$array_date[ 'year' ], |
|
| 130 | + self::$array_date[ 'month' ], |
|
| 131 | + self::$array_date[ 'day' ] |
|
| 132 | + ); |
|
| 133 | 133 | |
| 134 | - $this->date_time->setTime( |
|
| 135 | - self::$array_date[ 'hour' ], |
|
| 136 | - self::$array_date[ 'minute' ], |
|
| 137 | - self::$array_date[ 'second' ] |
|
| 138 | - ); |
|
| 134 | + $this->date_time->setTime( |
|
| 135 | + self::$array_date[ 'hour' ], |
|
| 136 | + self::$array_date[ 'minute' ], |
|
| 137 | + self::$array_date[ 'second' ] |
|
| 138 | + ); |
|
| 139 | 139 | |
| 140 | - $this->gregorian_DayofWeek = $this->date_time->format('w'); |
|
| 140 | + $this->gregorian_DayofWeek = $this->date_time->format('w'); |
|
| 141 | 141 | |
| 142 | - break; |
|
| 142 | + break; |
|
| 143 | 143 | |
| 144 | - case 'set': |
|
| 144 | + case 'set': |
|
| 145 | 145 | |
| 146 | - $this->date_time = Datium::$static_date_time; |
|
| 146 | + $this->date_time = Datium::$static_date_time; |
|
| 147 | 147 | |
| 148 | - $this->gregorian_DayofWeek = $this->date_time->format('w'); |
|
| 148 | + $this->gregorian_DayofWeek = $this->date_time->format('w'); |
|
| 149 | 149 | |
| 150 | 150 | } |
| 151 | 151 | |
@@ -59,9 +59,7 @@ discard block |
||
| 59 | 59 | if (( $year - 1 ) % 4 == 0 ) { |
| 60 | 60 | |
| 61 | 61 | $temp_day = $temp_day + 11; |
| 62 | - } |
|
| 63 | - |
|
| 64 | - else { |
|
| 62 | + } else { |
|
| 65 | 63 | |
| 66 | 64 | $temp_day = $temp_day + 10; |
| 67 | 65 | } |
@@ -74,9 +72,7 @@ discard block |
||
| 74 | 72 | |
| 75 | 73 | $day = 30; |
| 76 | 74 | |
| 77 | - } |
|
| 78 | - |
|
| 79 | - else { |
|
| 75 | + } else { |
|
| 80 | 76 | |
| 81 | 77 | $month = ( $temp_day / 30 ) + 10; |
| 82 | 78 | |
@@ -84,9 +80,7 @@ discard block |
||
| 84 | 80 | |
| 85 | 81 | } |
| 86 | 82 | |
| 87 | - } |
|
| 88 | - |
|
| 89 | - else { |
|
| 83 | + } else { |
|
| 90 | 84 | |
| 91 | 85 | $year = $year - 621; |
| 92 | 86 | |
@@ -99,18 +93,14 @@ discard block |
||
| 99 | 93 | $month = ( $temp_day / 31 ); |
| 100 | 94 | |
| 101 | 95 | $day = 31; |
| 102 | - } |
|
| 103 | - |
|
| 104 | - else { |
|
| 96 | + } else { |
|
| 105 | 97 | |
| 106 | 98 | $month = ( $temp_day / 31 ) + 1; |
| 107 | 99 | |
| 108 | 100 | $day = ( $temp_day % 31 ); |
| 109 | 101 | } |
| 110 | 102 | |
| 111 | - } |
|
| 112 | - |
|
| 113 | - else { |
|
| 103 | + } else { |
|
| 114 | 104 | |
| 115 | 105 | $temp_day = $temp_day - 186; |
| 116 | 106 | |
@@ -120,9 +110,7 @@ discard block |
||
| 120 | 110 | |
| 121 | 111 | $day = 30; |
| 122 | 112 | |
| 123 | - } |
|
| 124 | - |
|
| 125 | - else { |
|
| 113 | + } else { |
|
| 126 | 114 | |
| 127 | 115 | $month = ( $temp_day / 30 ) + 7; |
| 128 | 116 | |
@@ -179,9 +167,7 @@ discard block |
||
| 179 | 167 | |
| 180 | 168 | $days_of_gregorain_years = $days_of_gregorain_years - intval(( ( $year + 621 ) / 4 )); |
| 181 | 169 | |
| 182 | - } |
|
| 183 | - |
|
| 184 | - elseif (( ( 10 == $month ) && ( $day > 10 ) ) || ( $month > 10 ) ) { |
|
| 170 | + } elseif (( ( 10 == $month ) && ( $day > 10 ) ) || ( $month > 10 ) ) { |
|
| 185 | 171 | |
| 186 | 172 | $days_of_gregorain_years = $days_of_gregorain_years - intval(( ( $year + 622 ) / 4 )); |
| 187 | 173 | |
@@ -143,9 +143,7 @@ |
||
| 143 | 143 | |
| 144 | 144 | $days_of_gregorain_years = $days_of_gregorain_years - intval(( ( $this->year + 621 ) / 4 )); |
| 145 | 145 | |
| 146 | - } |
|
| 147 | - |
|
| 148 | - elseif (( ( 10 == $this->month ) && ( $this->day > 10 ) ) || ( $this->month > 10 ) ) { |
|
| 146 | + } elseif (( ( 10 == $this->month ) && ( $this->day > 10 ) ) || ( $this->month > 10 ) ) { |
|
| 149 | 147 | |
| 150 | 148 | $days_of_gregorain_years = $days_of_gregorain_years - intval(( ( $this->year + 622 ) / 4 )); |
| 151 | 149 | |
@@ -143,19 +143,19 @@ |
||
| 143 | 143 | |
| 144 | 144 | switch ( $this->local[ 'default_calendar' ] ) { |
| 145 | 145 | |
| 146 | - case 'jalali': |
|
| 146 | + case 'jalali': |
|
| 147 | 147 | |
| 148 | - $this->date_time->setDate(1394, $month, $day); |
|
| 148 | + $this->date_time->setDate(1394, $month, $day); |
|
| 149 | 149 | |
| 150 | - $this->date_time = Datium::create($this->date_time)->from('jalali')->to('gregorian')->object(); //$this->convert->jalaliToGregorian( $this->date_time ); |
|
| 150 | + $this->date_time = Datium::create($this->date_time)->from('jalali')->to('gregorian')->object(); //$this->convert->jalaliToGregorian( $this->date_time ); |
|
| 151 | 151 | |
| 152 | - break; |
|
| 152 | + break; |
|
| 153 | 153 | |
| 154 | - case 'hijri': |
|
| 154 | + case 'hijri': |
|
| 155 | 155 | |
| 156 | - $this->date_time = Datium::create($this->date_time)->from('hijri')->to('gregorian')->object(); // $this->convert->hijriToGregorian( $this->date_time ); |
|
| 156 | + $this->date_time = Datium::create($this->date_time)->from('hijri')->to('gregorian')->object(); // $this->convert->hijriToGregorian( $this->date_time ); |
|
| 157 | 157 | |
| 158 | - break; |
|
| 158 | + break; |
|
| 159 | 159 | |
| 160 | 160 | } |
| 161 | 161 | |