Skip to content

Commit

Permalink
Fixed getDateRelative() in API
Browse files Browse the repository at this point in the history
Co-Authored-By: Robert <7520987+pftnhr@users.noreply.github.com>
  • Loading branch information
markseuffert and pftnhr committed Mar 15, 2024
1 parent 4e69b5a commit 4eaee68
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions system/extensions/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -876,7 +876,7 @@ public function getDateStandard($text, $language = "") {

// 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));
Expand Down
4 changes: 2 additions & 2 deletions system/extensions/update-current.ini
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions system/extensions/update-latest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4eaee68

Please sign in to comment.