summaryrefslogtreecommitdiff
path: root/app/Date/JalaliDate.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Date/JalaliDate.php')
-rw-r--r--app/Date/JalaliDate.php61
1 files changed, 51 insertions, 10 deletions
diff --git a/app/Date/JalaliDate.php b/app/Date/JalaliDate.php
index 355e743f6c..f5274c6d24 100644
--- a/app/Date/JalaliDate.php
+++ b/app/Date/JalaliDate.php
@@ -1,6 +1,4 @@
<?php
-namespace Fisharebest\Webtrees\Date;
-
/**
* webtrees: online genealogy
* Copyright (C) 2015 webtrees development team
@@ -15,24 +13,39 @@ namespace Fisharebest\Webtrees\Date;
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+namespace Fisharebest\Webtrees\Date;
use Fisharebest\ExtCalendar\PersianCalendar;
use Fisharebest\Webtrees\I18N;
/**
- * Class JalaliDate - Definitions for the Jalali calendar
+ * Definitions for the Jalali calendar
*/
class JalaliDate extends CalendarDate {
- /** {@inheritdoc} */
+ /** @var integer[] Convert GEDCOM month names to month numbers */
public static $MONTH_ABBREV = array('' => 0, 'FARVA' => 1, 'ORDIB' => 2, 'KHORD' => 3, 'TIR' => 4, 'MORDA' => 5, 'SHAHR' => 6, 'MEHR' => 7, 'ABAN' => 8, 'AZAR' => 9, 'DEY' => 10, 'BAHMA' => 11, 'ESFAN' => 12);
- /** {@inheritdoc} */
+ /**
+ * Create a date from either:
+ * a Julian day number
+ * day/month/year strings from a GEDCOM date
+ * another CalendarDate object
+ *
+ * @param array|int|CalendarDate $date
+ */
public function __construct($date) {
$this->calendar = new PersianCalendar;
parent::__construct($date);
}
- /** {@inheritdoc} */
+ /**
+ * Full month name in nominative case.
+ *
+ * @param int $month_number
+ * @param bool $leap_year Some calendars use leap months
+ *
+ * @return string
+ */
public static function monthNameNominativeCase($month_number, $leap_year) {
static $translated_month_names;
@@ -57,7 +70,14 @@ class JalaliDate extends CalendarDate {
return $translated_month_names[$month_number];
}
- /** {@inheritdoc} */
+ /**
+ * Full month name in genitive case.
+ *
+ * @param int $month_number
+ * @param bool $leap_year Some calendars use leap months
+ *
+ * @return string
+ */
protected function monthNameGenitiveCase($month_number, $leap_year) {
static $translated_month_names;
@@ -82,7 +102,14 @@ class JalaliDate extends CalendarDate {
return $translated_month_names[$month_number];
}
- /** {@inheritdoc} */
+ /**
+ * Full month name in locative case.
+ *
+ * @param int $month_number
+ * @param bool $leap_year Some calendars use leap months
+ *
+ * @return string
+ */
protected function monthNameLocativeCase($month_number, $leap_year) {
static $translated_month_names;
@@ -107,7 +134,14 @@ class JalaliDate extends CalendarDate {
return $translated_month_names[$month_number];
}
- /** {@inheritdoc} */
+ /**
+ * Full month name in instrumental case.
+ *
+ * @param int $month_number
+ * @param bool $leap_year Some calendars use leap months
+ *
+ * @return string
+ */
protected function monthNameInstrumentalCase($month_number, $leap_year) {
static $translated_month_names;
@@ -132,7 +166,14 @@ class JalaliDate extends CalendarDate {
return $translated_month_names[$month_number];
}
- /** {@inheritdoc} */
+ /**
+ * Abbreviated month name
+ *
+ * @param int $month_number
+ * @param bool $leap_year Some calendars use leap months
+ *
+ * @return string
+ */
protected function monthNameAbbreviated($month_number, $leap_year) {
static $translated_month_names;