-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsantalidate.php
77 lines (61 loc) · 2.49 KB
/
santalidate.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
// Two options for connecting to the database:
class SantaliDate {
private $santaliletter = array ("᱐", // 0
"᱑", // 1
"᱒", // 2
"᱓", // 3
"᱔", // 4
"᱕", // 5
"᱖", // 6
"᱗", // 7
"᱘", // 8
"᱙", // 9
);
private $santalimonth = array (" ", // Nothing as 0 month
"ᱡᱟᱱᱩᱣᱟᱨᱤ", //january
"ᱯᱷᱮᱵᱽᱨᱩᱣᱟᱨᱤ", //february
"ᱢᱟᱨᱪ", //march
"ᱮᱯᱨᱤᱞ", //april
"ᱢᱮ", // may
"ᱡᱩᱱ", // june
"ᱡᱩᱞᱟᱭ", //july
"ᱚᱜᱚᱥᱴ", // august
"ᱥᱮᱯᱴᱮᱢᱵᱚᱨ", // september
"ᱚᱠᱴᱚᱵᱚᱨ", //october
"ᱱᱚᱵᱷᱮᱢᱵᱚᱨ", // november
"ᱰᱤᱥᱮᱢᱵᱚᱨ", // december
);
/**
* Constructor
*/
public function __construct(){
}
/*
Get an instance of the Database
@return Instance
*/
public function getMahit($date) {
$ret = "";
if (empty($date)) {
return $ret;
}
$items = strval($date);
$dateString = str_split($items);
foreach ($dateString as $value) {
if ($value == 0 or !empty($value)) {
$ret .= $this->santaliletter[intval($value)];
}
}
return $ret;
}
public function getMonth($month) {
$ret = "";
if (empty($month)) {
return $ret;
}
$ret .= $this->santalimonth[intval($month)];
return $ret;
}
}
?>