Skip to content

Commit c89ea43

Browse files
committed
Merge branch 'master' of https://github.com/GeniusTS/hijri-dates
2 parents d38d677 + 889db28 commit c89ea43

File tree

2 files changed

+98
-2
lines changed

2 files changed

+98
-2
lines changed

src/Converter.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public static function julianToHijri(float $julianDay)
106106
$z = $z - floor($j * $y + $shift1);
107107

108108
$year = 30 * $cyc + $j;
109-
$month = floor(($z + 28.5001) / 29.5);
109+
$month = (int)floor(($z + 28.5001) / 29.5);
110110
if ($month === 13)
111111
{
112112
$month = 12;
@@ -116,4 +116,4 @@ public static function julianToHijri(float $julianDay)
116116

117117
return (object) ['year' => (int) $year, 'month' => (int) $month, 'day' => (int) $day];
118118
}
119-
}
119+
}

src/Translations/Russian.php

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
<?php
2+
3+
namespace GeniusTS\HijriDate\Translations;
4+
5+
6+
/**
7+
* Class Russian
8+
*
9+
* @package GeniusTS\HijriDate\Translations
10+
*/
11+
class Russian implements TranslationInterface
12+
{
13+
14+
/**
15+
* Hijri Months names
16+
*
17+
* @var array
18+
*/
19+
protected $hijriMonths = [
20+
'Мухаррам',
21+
'Сафар',
22+
'Раби аль-авваль',
23+
'Раби ас-сани',
24+
'Джумада аль-уля',
25+
'Джумада ас-сани',
26+
'Раджаб',
27+
'Шабан',
28+
'Рамадан',
29+
'Шавваль',
30+
'Зу-ль-када',
31+
'Зу-ль-хиджа',
32+
];
33+
34+
/**
35+
* short days
36+
*
37+
* @var array
38+
*/
39+
protected $shortDays = ['ВС', 'ПН', 'ВТ', 'СР', 'ЧТ', 'ПТ', 'СБ'];
40+
41+
/**
42+
* days names
43+
*
44+
* @var array
45+
*/
46+
protected $days = ['Воскресенье', 'Понедельник', 'Вторник', 'Среда', 'Четверг', 'Пятница', 'Суббота'];
47+
48+
/**
49+
* periods
50+
*
51+
* @var array
52+
*/
53+
protected $periods = ['am', 'pm'];
54+
55+
/**
56+
* get array of months names
57+
*
58+
* @return array
59+
*/
60+
public function getHijriMonths(): array
61+
{
62+
return $this->hijriMonths;
63+
}
64+
65+
/**
66+
* get array of short days names
67+
* started from Sunday
68+
*
69+
* @return array
70+
*/
71+
public function getShortDays(): array
72+
{
73+
return $this->shortDays;
74+
}
75+
76+
/**
77+
* get array of months names
78+
* started from Sunday
79+
*
80+
* @return array
81+
*/
82+
public function getDays(): array
83+
{
84+
return $this->days;
85+
}
86+
87+
/**
88+
* get array of periods
89+
*
90+
* @return array
91+
*/
92+
public function getPeriods(): array
93+
{
94+
return $this->periods;
95+
}
96+
}

0 commit comments

Comments
 (0)