src/CalendarSettings/Ghamari.php 1 location
|
@@ 233-257 (lines=25) @@
|
| 230 |
|
11 => 30, |
| 231 |
|
12 => 30 ), |
| 232 |
|
|
| 233 |
|
'day_of_year' => function( $date_time ) { |
| 234 |
|
|
| 235 |
|
$result = null; |
| 236 |
|
|
| 237 |
|
$config = include( 'Ghamari.php' ); |
| 238 |
|
|
| 239 |
|
$month = $date_time->format('n'); |
| 240 |
|
|
| 241 |
|
$day = $date_time->format('d'); |
| 242 |
|
|
| 243 |
|
foreach( $config['month_days_number'] as $_month => $value ) { |
| 244 |
|
|
| 245 |
|
if ( $_month < $month ) { |
| 246 |
|
|
| 247 |
|
$result += $value; |
| 248 |
|
|
| 249 |
|
} |
| 250 |
|
|
| 251 |
|
} |
| 252 |
|
|
| 253 |
|
$result += $day; |
| 254 |
|
|
| 255 |
|
return $result + 1; |
| 256 |
|
|
| 257 |
|
}, |
| 258 |
|
|
| 259 |
|
'day_of_week' => function( $date_time ) { |
| 260 |
|
|
src/CalendarSettings/Shamsi.php 1 location
|
@@ 116-136 (lines=21) @@
|
| 113 |
|
12 => 29 ), |
| 114 |
|
|
| 115 |
|
|
| 116 |
|
'day_of_year' => function( $date_time ) { |
| 117 |
|
|
| 118 |
|
$result = null; |
| 119 |
|
|
| 120 |
|
$config = include( 'Shamsi.php' ); |
| 121 |
|
|
| 122 |
|
$month = $date_time->format('n'); |
| 123 |
|
|
| 124 |
|
$day = $date_time->format('d'); |
| 125 |
|
|
| 126 |
|
foreach( $config['month_days_number'] as $_month => $value ) { |
| 127 |
|
|
| 128 |
|
if ( $_month < $month ) $result += $value; |
| 129 |
|
|
| 130 |
|
} |
| 131 |
|
|
| 132 |
|
$result += $day; |
| 133 |
|
|
| 134 |
|
return $result + 1; |
| 135 |
|
|
| 136 |
|
}, |
| 137 |
|
|
| 138 |
|
'day_of_week' => function( $date_time ) { |
| 139 |
|
|