summaryrefslogtreecommitdiffstats
path: root/includes/giglogadmin-export-ical-handler.php
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/giglogadmin-export-ical-handler.php
parent9355261bfe664f181bd8b6c4fe23a2949e06769e (diff)
downloadgigologadmin-c2354e7397f44998691dfe8241e49c5a65f66dcc.tar.gz
gigologadmin-c2354e7397f44998691dfe8241e49c5a65f66dcc.tar.bz2
gigologadmin-c2354e7397f44998691dfe8241e49c5a65f66dcc.zip
Use DateTimeImmutable for concert date/time.
Diffstat (limited to 'includes/giglogadmin-export-ical-handler.php')
-rw-r--r--includes/giglogadmin-export-ical-handler.php11
1 files changed, 2 insertions, 9 deletions
diff --git a/includes/giglogadmin-export-ical-handler.php b/includes/giglogadmin-export-ical-handler.php
index 44afbea..c230638 100644
--- a/includes/giglogadmin-export-ical-handler.php
+++ b/includes/giglogadmin-export-ical-handler.php
@@ -30,11 +30,9 @@ if ( ! function_exists( 'giglogadmin_export_ical_handler' ) ) {
$cfullname = $concert->cname() . ' live at ' . $concert->venue()->name() . ', ' . $concert->venue()->city();
$cshortname = substr( $cfullname, 0, 20 );
- $fdate = strtotime( $concert->cdate() );
- $newformat = date( 'Ymd', $fdate );
$filename = sanitize_file_name(
- "Concert-{$concert->venue()->name()}-{$newformat}-"
+ "Concert-{$concert->venue()->name()}-{$concert->cdate()->format( 'Ymd' )}-"
. substr( $concert->cname(), 0, 30 )
);
@@ -58,12 +56,7 @@ if ( ! function_exists( 'giglogadmin_export_ical_handler' ) ) {
// place the event
->setLocation( "{$concert->venue()->name()}, {$concert->venue()->city()}" )
// set the time
- ->setDtstart(
- new DateTime(
- $newformat . 'T190000',
- new DateTimezone( 'Europe/Oslo' )
- )
- )
+ ->setDtstart( $concert->cdate() )
->setDuration( 'PT4H' );
header( 'Content-Type: text/calendar' );