1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of the EasyBanglaDate package. |
5
|
|
|
* |
6
|
|
|
* Copyright (c) 2015 Roni Saha |
7
|
|
|
* |
8
|
|
|
* This source file is subject to the MIT license that is bundled |
9
|
|
|
* with this source code in the file LICENSE. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace EasyBanglaDate\Tools; |
13
|
|
|
|
14
|
|
|
|
15
|
|
|
class MagicNumbers |
16
|
|
|
{ |
17
|
|
|
private static $magicArray = array( |
18
|
|
|
'1_4_JanuaryOrApril' => array(13, 16, 14, 16), |
19
|
|
|
'2_February' => array(12, 17, 13, 17), |
20
|
|
|
'5_6_MayOrJune' => array(14, 16, 15, 16), |
21
|
|
|
'7_8_9_JulyOrAugustOrSeptember' => array(15, 15, 16, 15), |
22
|
|
|
'10_October' => array(15, 14, 16, 14), |
23
|
|
|
'11_12_NovemberOrDecember' => array(14, 15, 15, 15), |
24
|
|
|
); |
25
|
|
|
|
26
|
|
|
private static $indexByMonth = array( |
27
|
|
|
"0", |
28
|
|
|
'1_4_JanuaryOrApril', |
29
|
|
|
'2_February', |
30
|
|
|
"3", |
31
|
|
|
'1_4_JanuaryOrApril', |
32
|
|
|
'5_6_MayOrJune', |
33
|
|
|
'5_6_MayOrJune', |
34
|
|
|
'7_8_9_JulyOrAugustOrSeptember', |
35
|
|
|
'7_8_9_JulyOrAugustOrSeptember', |
36
|
|
|
'7_8_9_JulyOrAugustOrSeptember', |
37
|
|
|
'10_October', |
38
|
|
|
'11_12_NovemberOrDecember', |
39
|
|
|
'11_12_NovemberOrDecember', |
40
|
|
|
); |
41
|
|
|
|
42
|
|
|
public static function getMagicArrayForMonth($month) |
43
|
|
|
{ |
44
|
|
|
return self::$magicArray[self::$indexByMonth[$month]]; |
45
|
|
|
} |
46
|
|
|
} |