From 79a61d50bdccaac2281bbcc59cb4b580e3df37d0 Mon Sep 17 00:00:00 2001 From: sdpdeploy Date: Tue, 27 Dec 2022 23:57:50 +0000 Subject: [PATCH 1/2] Merge changes from develop. --- composer.json | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/composer.json b/composer.json index 933184f2..b0524a0b 100644 --- a/composer.json +++ b/composer.json @@ -1,22 +1,22 @@ { - "name": "dpc-sdp/tide_landing_page", - "description": "Landing Page content type and related configuration for Tide Drupal 8 distribution", - "type": "drupal-module", - "license": "GPL-2.0-or-later", - "require": { - "dpc-sdp/tide_core": "^3.0.0", - "dpc-sdp/tide_event": "^3.0.0", - "dpc-sdp/tide_media": "^3.0.0" - }, - "suggest": { - "dpc-sdp/tide_api:^3.0.0": "Allows to use Drupal in headless mode", - "dpc-sdp/tide_webform:^3.0.0": "Allows to use questionnaires", - "dpc-sdp/tide_news:^3.0.0": "News content type and related configuration for Tide Drupal 8 distribution" - }, - "repositories": { - "drupal": { - "type": "composer", - "url": "https://packages.drupal.org/8" - } + "description": "Landing Page content type and related configuration for Tide Drupal 8 distribution", + "license": "GPL-2.0-or-later", + "name": "dpc-sdp/tide_landing_page", + "repositories": { + "drupal": { + "type": "composer", + "url": "https://packages.drupal.org/8" } + }, + "require": { + "dpc-sdp/tide_core": "dev-reference", + "dpc-sdp/tide_event": "dev-reference", + "dpc-sdp/tide_media": "dev-reference" + }, + "suggest": { + "dpc-sdp/tide_api:^3.0.0": "Allows to use Drupal in headless mode", + "dpc-sdp/tide_news:^3.0.0": "News content type and related configuration for Tide Drupal 8 distribution", + "dpc-sdp/tide_webform:^3.0.0": "Allows to use questionnaires" + }, + "type": "drupal-module" } From 6740fc9f988d1b65f1486eb5d3095c0fe8f8f197 Mon Sep 17 00:00:00 2001 From: Vincent Gao Date: Wed, 17 Jul 2024 14:40:31 +1000 Subject: [PATCH 2/2] test 9438 --- src/Helper/TideLandingPageHelper.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/Helper/TideLandingPageHelper.php b/src/Helper/TideLandingPageHelper.php index 24e46ee0..db500fc1 100644 --- a/src/Helper/TideLandingPageHelper.php +++ b/src/Helper/TideLandingPageHelper.php @@ -20,14 +20,16 @@ class TideLandingPageHelper { * The converted date. */ public static function localDateAndTimeFormatter($date) { - // Parse date with GMT timezone. - $storage_tz = DateTimeItemInterface::STORAGE_TIMEZONE; - $drupal_date_time = new DrupalDateTime($date, $storage_tz); - // Convert to local timezone. - $system_tz = \Drupal::service('config.factory')->get('system.date')->get('timezone.default'); - $date_formatter = \Drupal::service('date.formatter'); - $converted_date = $date_formatter->format($drupal_date_time->getTimeStamp(), 'custom', 'Y-m-d H:i:s', $system_tz); - return $converted_date; + if (!empty($date)) { + // Parse date with GMT timezone. + $storage_tz = DateTimeItemInterface::STORAGE_TIMEZONE; + $drupal_date_time = new DrupalDateTime($date, $storage_tz); + // Convert to local timezone. + $system_tz = \Drupal::service('config.factory')->get('system.date')->get('timezone.default'); + $date_formatter = \Drupal::service('date.formatter'); + $converted_date = $date_formatter->format($drupal_date_time->getTimeStamp(), 'custom', 'Y-m-d H:i:s', $system_tz); + return $converted_date; + } } }