| @@ 270-290 (lines=21) @@ | ||
| 267 | ||
| 268 | }, |
|
| 269 | ||
| 270 | 'day_of_week' => function( $date_time ) { |
|
| 271 | ||
| 272 | $configGhamari = include( 'Ghamari.php' ); |
|
| 273 | ||
| 274 | $configGregorian = include( 'Gregorian.php' ); |
|
| 275 | ||
| 276 | $day = $date_time->format('l'); |
|
| 277 | ||
| 278 | $day = str_replace( $configGregorian['days_of_week'], $configGhamari['days_of_week'], $day); |
|
| 279 | ||
| 280 | foreach ( $configGhamari['days_of_week'] as $key => $value ) { |
|
| 281 | ||
| 282 | if( $value == $day ) { |
|
| 283 | ||
| 284 | return $key += 1; |
|
| 285 | ||
| 286 | } |
|
| 287 | ||
| 288 | } |
|
| 289 | ||
| 290 | }, |
|
| 291 | ||
| 292 | /************************************************************ |
|
| 293 | * Leap year |
|
| @@ 315-335 (lines=21) @@ | ||
| 312 | ||
| 313 | }, |
|
| 314 | ||
| 315 | 'day_of_week' => function( $date_time ) { |
|
| 316 | ||
| 317 | $configShamsi = include( 'Shamsi.php' ); |
|
| 318 | ||
| 319 | $configGregorian = include( 'Gregorian.php' ); |
|
| 320 | ||
| 321 | $day = $date_time->format('l'); |
|
| 322 | ||
| 323 | $day = str_replace( $configGregorian['days_of_week'], $configShamsi['days_of_week'], $day ); |
|
| 324 | ||
| 325 | foreach ( $configShamsi['days_of_week'] as $key => $value ) { |
|
| 326 | ||
| 327 | if( $value == $day ) { |
|
| 328 | ||
| 329 | return $key += 1; |
|
| 330 | ||
| 331 | } |
|
| 332 | ||
| 333 | } |
|
| 334 | ||
| 335 | }, |
|
| 336 | ||
| 337 | /************************************************************ |
|
| 338 | * Leap year |
|