Commit 940051e6 authored by Susanne Moog's avatar Susanne Moog Committed by Stefan Neufeind
Browse files

[BUGFIX] Make daterange filtering in EXT:belog work again

Use ISO dates and date time objects consistently.

Change-Id: I1095f6690a3b73217657cc2577ebdaf6d7ff5fc0
Releases: master, 8.7
Resolves: #82126
Reviewed-on: https://review.typo3.org/55037


Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: Benjamin Kott's avatarBenjamin Kott <benjamin.kott@outlook.com>
Tested-by: Benjamin Kott's avatarBenjamin Kott <benjamin.kott@outlook.com>
Reviewed-by: default avatarStefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: default avatarStefan Neufeind <typo3.neufeind@speedpartner.de>
parent beda4afe
......@@ -357,12 +357,33 @@ abstract class AbstractController extends ActionController
$startTime = mktime(0, 0, 0) - 31 * 3600 * 24;
break;
case self::TIMEFRAME_CUSTOM:
$startTime = $constraint->getStartTimestamp();
if ($constraint->getEndTimestamp() > $constraint->getStartTimestamp()) {
$endTime = $constraint->getEndTimestamp();
} else {
$endTime = $GLOBALS['EXEC_TIME'];
$startDate = $constraint->getManualDateStart();
$endDate = $constraint->getManualDateStop();
$endTime = $GLOBALS['EXEC_TIME'];
if (!$startDate) {
$startDate = \DateTime::createFromFormat(
'U',
0
);
$constraint->setManualDateStart(
$startDate
);
}
if (!$endDate) {
$endDate = \DateTime::createFromFormat(
'U',
$endTime
)->setTimezone(new \DateTimeZone(date_default_timezone_get()));
$constraint->setManualDateStop(
$endDate
);
}
$startTime = $startDate->getTimestamp();
if ($endDate->getTimestamp() > $startDate->getTimestamp()) {
$endTime = $endDate->getTimestamp();
}
break;
default:
}
......
......@@ -108,12 +108,15 @@
<div class="input-group input-group-sm">
<f:form.textfield
name="manualDateStart"
value="{f:if(condition: constraint.startTimestamp, then: \"{f:format.date(format:'{settings.timeFormat} {settings.dateFormat}', date: '@{constraint.startTimestamp}')}\")}"
value="{f:if(condition: constraint.manualDateStart, then: \"{f:format.date(format:'{settings.timeFormat} {settings.dateFormat}', date: '{constraint.manualDateStart}')}\")}"
id="manualDateStart"
class="form-control input-sm t3js-datetimepicker t3js-clearable"
data="{date-type: 'datetime'}"
/>
<f:form.hidden property="startTimestamp" value="{constraint.startTimestamp}" />
<f:form.hidden
property="manualDateStart"
value="{f:if(condition: constraint.manualDateStart, then: \"{f:format.date(format:'c', date: '{constraint.manualDateStart}')}\")}"
/>
<span class="input-group-btn">
<label class="btn btn-default" for="manualDateStart">
<span class="fa fa-calendar"></span>
......@@ -128,12 +131,14 @@
<div class="input-group input-group-sm">
<f:form.textfield
name="manualDateStop"
value="{f:format.date(format:'{settings.timeFormat} {settings.dateFormat}', date: '@{constraint.endTimestamp}')}"
value="{f:format.date(format:'{settings.timeFormat} {settings.dateFormat}', date: '{constraint.manualDateStop}')}"
id="manualDateStop"
class="form-control input-sm t3js-datetimepicker t3js-clearable"
data="{date-type: 'datetime'}"
/>
<f:form.hidden property="endTimestamp" />
<f:form.hidden property="manualDateStop"
value="{f:format.date(format:'c', date: '{constraint.manualDateStop}')}"
/>
<span class="input-group-btn">
<label class="btn btn-default" for="manualDateStop">
<span class="fa fa-calendar"></span>
......
......@@ -9,8 +9,8 @@
<f:translate
key="timeInfo"
arguments="{
0: '{f:format.date(format:\'{settings.dateFormat} {settings.timeFormat}\', date:\'@{constraint.startTimestamp}\')}',
1: '{f:format.date(format:\'{settings.dateFormat} {settings.timeFormat}\', date:\'@{constraint.endTimestamp}\')}'
0: '{f:format.date(format:\'{settings.dateFormat} {settings.timeFormat}\', date:\'{constraint.manualDateStart}\')}',
1: '{f:format.date(format:\'{settings.dateFormat} {settings.timeFormat}\', date:\'{constraint.manualDateStop}\')}'
}"
/>
<p>
......@@ -42,8 +42,8 @@
key="logForNonPageRelatedActionsOrRootLevelOrPage"
arguments="{
0: '{f:translate(key:\'forNonPageRelatedActions\')}',
1: '{f:format.date(format:\'{settings.dateFormat} {settings.timeFormat}\', date:\'@{constraint.startTimestamp}\')}',
2: '{f:format.date(format:\'{settings.dateFormat} {settings.timeFormat}\', date:\'@{constraint.endTimestamp}\')}'
1: '{f:format.date(format:\'{settings.dateFormat} {settings.timeFormat}\', date:\'{constraint.manualDateStart}\')}',
2: '{f:format.date(format:\'{settings.dateFormat} {settings.timeFormat}\', date:\'{constraint.manualDateStop}\')}'
}"
/>
</f:if>
......@@ -52,8 +52,8 @@
key="logForNonPageRelatedActionsOrRootLevelOrPage"
arguments="{
0: '{f:translate(key:\'forRootLevel\')}',
1: '{f:format.date(format:\'{settings.dateFormat} {settings.timeFormat}\', date:\'@{constraint.startTimestamp}\')}',
2: '{f:format.date(format:\'{settings.dateFormat} {settings.timeFormat}\', date:\'@{constraint.endTimestamp}\')}'
1: '{f:format.date(format:\'{settings.dateFormat} {settings.timeFormat}\', date:\'{constraint.manualDateStart}\')}',
2: '{f:format.date(format:\'{settings.dateFormat} {settings.timeFormat}\', date:\'{constraint.manualDateStop}\')}'
}"
/>
</f:if>
......@@ -76,8 +76,8 @@
1:\\\'{pid}\\\'
}\'
)}',
1: '{f:format.date(format:\'{settings.dateFormat} {settings.timeFormat}\', date:\'@{constraint.startTimestamp}\')}',
2: '{f:format.date(format:\'{settings.dateFormat} {settings.timeFormat}\', date:\'@{constraint.endTimestamp}\')}'
1: '{f:format.date(format:\'{settings.dateFormat} {settings.timeFormat}\', date:\'{constraint.manualDateStart}\')}',
2: '{f:format.date(format:\'{settings.dateFormat} {settings.timeFormat}\', date:\'{constraint.manualDateStop}\')}'
}"
/>
</f:format.raw>
......@@ -89,8 +89,8 @@
key="logForNonPageRelatedActionsOrRootLevelOrPage"
arguments="{
0: '',
1: '{f:format.date(format:\'{settings.dateFormat} {settings.timeFormat}\', date:\'@{constraint.startTimestamp}\')}',
2: '{f:format.date(format:\'{settings.dateFormat} {settings.timeFormat}\', date:\'@{constraint.endTimestamp}\')}'
1: '{f:format.date(format:\'{settings.dateFormat} {settings.timeFormat}\', date:\'{constraint.manualDateStart}\')}',
2: '{f:format.date(format:\'{settings.dateFormat} {settings.timeFormat}\', date:\'{constraint.manualDateStop}\')}'
}"
/>
</f:else>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment