diff --git a/html/modules/custom/hr_paragraphs/hr_paragraphs.module b/html/modules/custom/hr_paragraphs/hr_paragraphs.module index 2a2fe60d..f1640d3b 100644 --- a/html/modules/custom/hr_paragraphs/hr_paragraphs.module +++ b/html/modules/custom/hr_paragraphs/hr_paragraphs.module @@ -1318,6 +1318,16 @@ function hr_paragraphs_validate_date_filter_values($code, array $values) { } } + // Format the dates to ISO 8601. + if (!empty($dates['from'])) { + $dates['from'] = $dates['from']->format('c'); + } + // The `to` date is inclusive, so we add 1 day minus 1 second to the + // `to` date so that we cover the entire day. + if (!empty($dates['to'])) { + $dates['to'] = $dates['to']->modify('+1 day -1 second')->format('c'); + } + return $dates; } diff --git a/html/modules/custom/hr_paragraphs/src/Controller/ReliefwebController.php b/html/modules/custom/hr_paragraphs/src/Controller/ReliefwebController.php index 2ba4a6f1..ff819cc2 100644 --- a/html/modules/custom/hr_paragraphs/src/Controller/ReliefwebController.php +++ b/html/modules/custom/hr_paragraphs/src/Controller/ReliefwebController.php @@ -608,6 +608,7 @@ public function parseReliefwebUrl(string $url) : array { } else { $conditions[$key] = $condition; + $conditions[$key]['value'] = $condition['processed'] ?? $condition['value']; } } }