Various: Replace deprecated functions to support php 8.3
This commit is contained in:
@@ -6,6 +6,8 @@ use \DateInterval;
|
||||
|
||||
class Agenda {
|
||||
|
||||
private $activities;
|
||||
|
||||
const TODAY = 0;
|
||||
const TOMORROW = 1;
|
||||
const THIS_WEEK = 2;
|
||||
@@ -18,7 +20,7 @@ class Agenda {
|
||||
}
|
||||
|
||||
public static function getFormattedDate($date) {
|
||||
return trim(strftime('%A %e. %b %H.%M', $date->getTimeStamp()));
|
||||
return $date->format("l j. M H.i");
|
||||
}
|
||||
|
||||
public function getEventsBetween(DateTimeImmutable $from, DateTimeImmutable $to) {
|
||||
|
@@ -5,6 +5,7 @@ use \DateTimeImmutable;
|
||||
use \PDO;
|
||||
|
||||
class DBActivity implements Activity {
|
||||
private $pdo;
|
||||
|
||||
public function __construct(PDO $pdo) {
|
||||
$this->pdo = $pdo;
|
||||
|
@@ -24,7 +24,7 @@ abstract class Event {
|
||||
return 'i morgen';
|
||||
}
|
||||
if (Agenda::isThisWeek($this->getStart()) || $this->getStart()->sub(new DateInterval('P4D'))->getTimestamp() < time()) {
|
||||
return strftime('%A', $this->getStart()->getTimestamp());
|
||||
return $this->getStart()->format("l");
|
||||
}
|
||||
if (Agenda::isNextWeek($this->getStart())) {
|
||||
return 'neste uke';
|
||||
@@ -32,7 +32,7 @@ abstract class Event {
|
||||
if (Agenda::isThisMonth($this->getStart())) {
|
||||
return 'denne måneden';
|
||||
}
|
||||
return trim(strftime('%e. %B', $this->getStart()->getTimestamp()));
|
||||
return $this->getStart()->format("j. F");
|
||||
}
|
||||
|
||||
public abstract function getStop(); /* : DateTimeImmutable */
|
||||
|
@@ -5,7 +5,7 @@ class SimpleEvent extends Event {
|
||||
|
||||
private $id, $name, $descr, $start, $end, $org, $loc;
|
||||
|
||||
public function __construct($id, $name,\DateTimeImmutable $start,\DateTimeImmutable $end,$org, $loc, $descr, $isDBEvent = false){
|
||||
public function __construct($id, $name,\DateTimeImmutable $start,\DateTimeImmutable $end,$org, $loc, $descr, $_isDBEvent = false){
|
||||
$this->id = $id;
|
||||
$this->name = $name;
|
||||
$this->start = $start;
|
||||
@@ -13,7 +13,6 @@ class SimpleEvent extends Event {
|
||||
$this->org = $org;
|
||||
$this->loc = $loc;
|
||||
$this->descr = explode("\n", $descr);
|
||||
$this->isDBEvent = $isDBEvent;
|
||||
}
|
||||
|
||||
public function getID(){
|
||||
@@ -52,10 +51,6 @@ class SimpleEvent extends Event {
|
||||
return $this->descr;
|
||||
}
|
||||
|
||||
public function isDBEvent() {
|
||||
return $this->isDBEvent;
|
||||
}
|
||||
|
||||
public function getColor() {
|
||||
return "#3b7";
|
||||
}
|
||||
|
Reference in New Issue
Block a user