Skip to content

Commit

Permalink
2321: Added infrastructure files
Browse files Browse the repository at this point in the history
  • Loading branch information
tuj committed Nov 8, 2024
1 parent c1d6ee9 commit 5c4e6ee
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,15 @@ CLI_REDIRECT={{ getenv "APP_CLI_REDIRECT" "" }}
REDIS_CACHE_PREFIX={{ getenv "APP_CLI_REDIRECT" "DisplayApiService" }}
REDIS_CACHE_DSN={{ getenv "APP_CLI_REDIRECT" "redis://redis:6379/0" }}
###< redis ###

###> Calendar Api Feed Source ###
CALENDAR_API_FEED_SOURCE_LOCATION_ENDPOINT={{ getenv "APP_CALENDAR_API_FEED_SOURCE_LOCATION_ENDPOINT" "" }}
CALENDAR_API_FEED_SOURCE_RESOURCE_ENDPOINT={{ getenv "APP_CALENDAR_API_FEED_SOURCE_RESOURCE_ENDPOINT" "" }}
CALENDAR_API_FEED_SOURCE_EVENT_ENDPOINT={{ getenv "APP_CALENDAR_API_FEED_SOURCE_EVENT_ENDPOINT" "" }}
CALENDAR_API_FEED_SOURCE_CUSTOM_MAPPINGS={{ getenv "APP_CALENDAR_API_FEED_SOURCE_CUSTOM_MAPPINGS" "'{}'" }}
CALENDAR_API_FEED_SOURCE_EVENT_MODIFIERS={{ getenv "APP_CALENDAR_API_FEED_SOURCE_EVENT_MODIFIERS" "'{}'" }}
CALENDAR_API_FEED_SOURCE_DATE_FORMAT={{ getenv "APP_CALENDAR_API_FEED_SOURCE_DATE_FORMAT" "" }}
CALENDAR_API_FEED_SOURCE_DATE_TIMEZONE={{ getenv "APP_CALENDAR_API_FEED_SOURCE_DATE_TIMEZONE" "" }}
CALENDAR_API_FEED_SOURCE_CACHE_EXPIRE_RESOURCES={{ getenv "APP_CALENDAR_API_FEED_SOURCE_CACHE_EXPIRE_RESOURCES" "3600" }}
CALENDAR_API_FEED_SOURCE_CACHE_EXPIRE_EVENTS={{ getenv "APP_CALENDAR_API_FEED_SOURCE_CACHE_EXPIRE_EVENTS" "300" }}
###< Calendar Api Feed Source ###
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,15 @@ CLI_REDIRECT={{ getenv "APP_CLI_REDIRECT" "" }}
REDIS_CACHE_PREFIX={{ getenv "APP_CLI_REDIRECT" "DisplayApiService" }}
REDIS_CACHE_DSN={{ getenv "APP_CLI_REDIRECT" "redis://redis:6379/0" }}
###< redis ###

###> Calendar Api Feed Source ###
CALENDAR_API_FEED_SOURCE_LOCATION_ENDPOINT={{ getenv "APP_CALENDAR_API_FEED_SOURCE_LOCATION_ENDPOINT" "" }}
CALENDAR_API_FEED_SOURCE_RESOURCE_ENDPOINT={{ getenv "APP_CALENDAR_API_FEED_SOURCE_RESOURCE_ENDPOINT" "" }}
CALENDAR_API_FEED_SOURCE_EVENT_ENDPOINT={{ getenv "APP_CALENDAR_API_FEED_SOURCE_EVENT_ENDPOINT" "" }}
CALENDAR_API_FEED_SOURCE_CUSTOM_MAPPINGS={{ getenv "APP_CALENDAR_API_FEED_SOURCE_CUSTOM_MAPPINGS" "'{}'" }}
CALENDAR_API_FEED_SOURCE_EVENT_MODIFIERS={{ getenv "APP_CALENDAR_API_FEED_SOURCE_EVENT_MODIFIERS" "'{}'" }}
CALENDAR_API_FEED_SOURCE_DATE_FORMAT={{ getenv "APP_CALENDAR_API_FEED_SOURCE_DATE_FORMAT" "" }}
CALENDAR_API_FEED_SOURCE_DATE_TIMEZONE={{ getenv "APP_CALENDAR_API_FEED_SOURCE_DATE_TIMEZONE" "" }}
CALENDAR_API_FEED_SOURCE_CACHE_EXPIRE_RESOURCES={{ getenv "APP_CALENDAR_API_FEED_SOURCE_CACHE_EXPIRE_RESOURCES" "3600" }}
CALENDAR_API_FEED_SOURCE_CACHE_EXPIRE_EVENTS={{ getenv "APP_CALENDAR_API_FEED_SOURCE_CACHE_EXPIRE_EVENTS" "300" }}
###< Calendar Api Feed Source ###
6 changes: 2 additions & 4 deletions src/Feed/CalendarApiFeedType.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ public function __construct(
}

/**
* @param Feed $feed
*
* @return array
* {@inheritDoc}
*/
public function getData(Feed $feed): array
{
Expand Down Expand Up @@ -372,7 +370,7 @@ private function stringToUnixTimestamp(string $dateTimeString): int
$dateFormat = $this->dateFormat !== '' ? $this->dateFormat : \DateTimeInterface::ATOM;
// Default is no timezone since the difference from UTC is in the dateformat (+00:00).
// For timezone options see: https://www.php.net/manual/en/timezones.php
$timezone = $this->timezone !== '' ? new \DateTimeZone($this->timezone) : null;
$timezone = !empty($this->timezone) ? new \DateTimeZone($this->timezone) : null;

$datetime = \DateTime::createFromFormat($dateFormat, $dateTimeString, $timezone);

Expand Down

0 comments on commit 5c4e6ee

Please sign in to comment.