commit c9fa14ba45453ad2a5abb922192f4fad8ef4721d
parent 3b397715028ebf4d92c915057cd60005358972b8
Author: markseu <mark2011@mayberg.se>
Date: Wed, 16 Dec 2020 16:24:29 +0100
Added support for genitive month names
Diffstat:
3 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/system/extensions/core.php b/system/extensions/core.php
@@ -2,7 +2,7 @@
// Core extension, https://github.com/datenstrom/yellow-extensions/tree/master/source/core
class YellowCore {
- const VERSION = "0.8.38";
+ const VERSION = "0.8.39";
const RELEASE = "0.8.16";
public $page; // current page
public $content; // content files
@@ -1828,16 +1828,19 @@ class YellowLanguage {
// Return human readable date
public function getDateFormatted($timestamp, $format, $language = "") {
- $dateMonths = preg_split("/\s*,\s*/", $this->getText("coreDateMonths", $language));
+ $dateMonthsNominative = preg_split("/\s*,\s*/", $this->getText("coreDateMonthsNominative", $language));
+ $dateMonthsGenitive = preg_split("/\s*,\s*/", $this->getText("coreDateMonthsGenitive", $language));
$dateWeekdays = preg_split("/\s*,\s*/", $this->getText("coreDateWeekdays", $language));
- $month = $dateMonths[date("n", $timestamp) - 1];
+ $monthNominative = $dateMonthsNominative[date("n", $timestamp) - 1];
+ $monthGenitive = $dateMonthsGenitive[date("n", $timestamp) - 1];
$weekday = $dateWeekdays[date("N", $timestamp) - 1];
$timeZone = $this->yellow->system->get("coreServerTimezone");
$timeZoneHelper = new DateTime(null, new DateTimeZone($timeZone));
$timeZoneOffset = $timeZoneHelper->getOffset();
$timeZoneAbbreviation = "GMT".($timeZoneOffset<0 ? "-" : "+").abs(intval($timeZoneOffset/3600));
- $format = preg_replace("/(?<!\\\)F/", addcslashes($month, "A..Za..z"), $format);
- $format = preg_replace("/(?<!\\\)M/", addcslashes(substru($month, 0, 3), "A..Za..z"), $format);
+ $format = preg_replace("/(?<!\\\)F/", addcslashes($monthNominative, "A..Za..z"), $format);
+ $format = preg_replace("/(?<!\\\)V/", addcslashes($monthGenitive, "A..Za..z"), $format);
+ $format = preg_replace("/(?<!\\\)M/", addcslashes(substru($monthNominative, 0, 3), "A..Za..z"), $format);
$format = preg_replace("/(?<!\\\)D/", addcslashes(substru($weekday, 0, 3), "A..Za..z"), $format);
$format = preg_replace("/(?<!\\\)l/", addcslashes($weekday, "A..Za..z"), $format);
$format = preg_replace("/(?<!\\\)T/", addcslashes($timeZoneAbbreviation, "A..Za..z"), $format);
diff --git a/system/extensions/install-languages.zip b/system/extensions/install-languages.zip
Binary files differ.
diff --git a/system/extensions/update-current.ini b/system/extensions/update-current.ini
@@ -21,11 +21,11 @@ Tag: feature
system/extensions/command.php: command.php, create, update
Extension: Core
-Version: 0.8.38
+Version: 0.8.39
Description: Core functionality of the website.
HelpUrl: https://github.com/datenstrom/yellow-extensions/tree/master/source/core
DownloadUrl: https://github.com/datenstrom/yellow-extensions/raw/master/zip/core.zip
-Published: 2020-12-09 17:27:20
+Published: 2020-12-16 14:56:08
Developer: Datenstrom
Tag: feature
system/extensions/core.php: core.php, create, update