Fixed getDateRelative() in API

Co-Authored-By: Robert <7520987+pftnhr@users.noreply.github.com>
This commit is contained in:
markseu 2024-03-15 13:38:41 +01:00
parent 4e69b5ac18
commit 4eaee68fd4
3 changed files with 6 additions and 6 deletions

View file

@ -2,7 +2,7 @@
// Core extension, https://github.com/annaesvensson/yellow-core
class YellowCore {
const VERSION = "0.8.125";
const VERSION = "0.8.126";
const RELEASE = "0.8.23";
public $content; // content files
public $media; // media files
@ -876,7 +876,7 @@ class YellowLanguage {
// Return Unix time as date, relative to today
public function getDateRelative($timestamp, $format, $daysLimit, $language = "") {
$timeDifference = time() - $timestamp;
$timeDifference = mktime(0, 0, 0) - strtotime(date("Y-m-d", $timestamp));
$days = abs(intval($timeDifference/86400));
$key = $timeDifference>=0 ? "coreDatePast" : "coreDateFuture";
$tokens = preg_split("/\s*,\s*/", $this->getText($key, $language));

View file

@ -1,12 +1,12 @@
# Datenstrom Yellow update settings
Extension: Core
Version: 0.8.125
Version: 0.8.126
Description: Core functionality of your website.
DownloadUrl: https://github.com/annaesvensson/yellow-core/archive/refs/heads/main.zip
DocumentationUrl: https://github.com/annaesvensson/yellow-core
DocumentationLanguage: en, de, sv
Published: 2023-10-27 17:02:46
Published: 2024-03-15 13:36:26
Developer: Anna Svensson
Tag: feature
system/extensions/core.php: core.php, create, update

View file

@ -126,12 +126,12 @@ system/themes/copenhagen.css: copenhagen.css, create, update, careful
system/themes/copenhagen.png: copenhagen.png, create
Extension: Core
Version: 0.8.125
Version: 0.8.126
Description: Core functionality of your website.
DownloadUrl: https://github.com/annaesvensson/yellow-core/archive/refs/heads/main.zip
DocumentationUrl: https://github.com/annaesvensson/yellow-core
DocumentationLanguage: en, de, sv
Published: 2023-10-27 17:02:46
Published: 2024-03-15 13:36:26
Developer: Anna Svensson
Tag: feature
system/extensions/core.php: core.php, create, update