mirror of
https://github.com/friendica/friendica
synced 2025-04-27 10:30:10 +00:00
Replace remaining functions in include/datetime by Temporal methods
- Fix uses statements
This commit is contained in:
parent
d0c9e7939c
commit
cea80c78e4
20 changed files with 60 additions and 48 deletions
|
@ -14,6 +14,7 @@ use Friendica\Database\DBM;
|
|||
use Friendica\Model\Contact;
|
||||
use Friendica\Model\Profile;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
use Friendica\Util\Temporal;
|
||||
use Friendica\Util\XML;
|
||||
|
||||
require_once 'include/dba.php';
|
||||
|
@ -45,7 +46,7 @@ class NotificationsManager extends BaseObject
|
|||
foreach ($notes as $n) {
|
||||
$local_time = DateTimeFormat::local($n['date']);
|
||||
$n['timestamp'] = strtotime($local_time);
|
||||
$n['date_rel'] = relative_date($n['date']);
|
||||
$n['date_rel'] = Temporal::getRelativeDate($n['date']);
|
||||
$n['msg_html'] = bbcode($n['msg'], false, false, false, false);
|
||||
$n['msg_plain'] = explode("\n", trim(html2plain($n['msg_html'], 0)))[0];
|
||||
|
||||
|
@ -245,7 +246,7 @@ class NotificationsManager extends BaseObject
|
|||
$default_item_url = $it['url'];
|
||||
$default_item_text = strip_tags(bbcode($it['msg']));
|
||||
$default_item_when = DateTimeFormat::local($it['date'], 'r');
|
||||
$default_item_ago = relative_date($it['date']);
|
||||
$default_item_ago = Temporal::getRelativeDate($it['date']);
|
||||
break;
|
||||
|
||||
case 'home':
|
||||
|
@ -255,7 +256,7 @@ class NotificationsManager extends BaseObject
|
|||
$default_item_url = $it['author-link'];
|
||||
$default_item_text = L10n::t("%s commented on %s's post", $it['author-name'], $it['pname']);
|
||||
$default_item_when = DateTimeFormat::local($it['created'], 'r');
|
||||
$default_item_ago = relative_date($it['created']);
|
||||
$default_item_ago = Temporal::getRelativeDate($it['created']);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -267,7 +268,7 @@ class NotificationsManager extends BaseObject
|
|||
? L10n::t("%s created a new post", $it['author-name'])
|
||||
: L10n::t("%s commented on %s's post", $it['author-name'], $it['pname']));
|
||||
$default_item_when = DateTimeFormat::local($it['created'], 'r');
|
||||
$default_item_ago = relative_date($it['created']);
|
||||
$default_item_ago = Temporal::getRelativeDate($it['created']);
|
||||
}
|
||||
|
||||
// Transform the different types of notification in an usable array
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue