summaryrefslogtreecommitdiffstats
path: root/includes/view-helpers
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2023-01-28 17:38:32 +0100
committerHarald Eilertsen <haraldei@anduin.net>2023-01-28 17:38:32 +0100
commitc2354e7397f44998691dfe8241e49c5a65f66dcc (patch)
tree5e910758e81742b37bf0a2ef3be15eed5941dead /includes/view-helpers
parent9355261bfe664f181bd8b6c4fe23a2949e06769e (diff)
downloadgigologadmin-c2354e7397f44998691dfe8241e49c5a65f66dcc.tar.gz
gigologadmin-c2354e7397f44998691dfe8241e49c5a65f66dcc.tar.bz2
gigologadmin-c2354e7397f44998691dfe8241e49c5a65f66dcc.zip
Use DateTimeImmutable for concert date/time.
Diffstat (limited to 'includes/view-helpers')
-rw-r--r--includes/view-helpers/class-giglogadmin-concertform.php2
-rw-r--r--includes/view-helpers/class-giglogadmin-concertstable.php2
2 files changed, 2 insertions, 2 deletions
diff --git a/includes/view-helpers/class-giglogadmin-concertform.php b/includes/view-helpers/class-giglogadmin-concertform.php
index 5cc3a47..cf7a466 100644
--- a/includes/view-helpers/class-giglogadmin-concertform.php
+++ b/includes/view-helpers/class-giglogadmin-concertform.php
@@ -66,7 +66,7 @@ if ( ! class_exists( 'GiglogAdmin_ConcertForm' ) ) {
. '<label for="venue">Venue:</label>' . $this->get_venue_selector( $c->venue() ) . '<br>'
// date has to be formatted else it is not red in the date field of html form
. '<label for="cdate">Date:</label>'
- . '<input type="date" id="cdate" name="cdate" value="' . esc_attr( date( 'Y-m-d', strtotime( $c->cdate() ?? '' ) ) ) . '"><br>'
+ . '<input type="date" id="cdate" name="cdate" value="' . esc_attr( $c->cdate()->format( 'Y-m-d' ) ?? '' ) . '"><br>'
. '<label for="ticket">Tickets:</label>'
. '<input type="text" id="ticket" name="ticket" value="' . esc_url( $c->tickets() ) . '"><br>'
. '<label for="eventurl">Event link:</label>'
diff --git a/includes/view-helpers/class-giglogadmin-concertstable.php b/includes/view-helpers/class-giglogadmin-concertstable.php
index 1288cbd..9bf848c 100644
--- a/includes/view-helpers/class-giglogadmin-concertstable.php
+++ b/includes/view-helpers/class-giglogadmin-concertstable.php
@@ -291,7 +291,7 @@ if ( ! class_exists( 'GiglogAdmin_ConcertsTable' ) ) {
$content .= '</td>';
$content .=
- '<td>' . date( 'd.M.Y', strtotime( $concert->cdate() ) ) . '</td>'
+ '<td>' . $concert->cdate()->format( 'd.m.Y' ) . '</td>'
. '<td>' . strtoupper( esc_html( $concert->cname() ) ) . '</td>'
. '<td>' . esc_html( $concert->venue()->name() ) . '</td>';