This patch fixes multiple issues when generating a date in AdminPanel's
preview module:
- The order of the date segements is changed to have a valid ISO format
- Months are 0-based in JavaScript (0 = January, 11 = December), for this
reason, +1 is added to have a valid date string
Resolves: #87060
Releases: master
Change-Id: Ib6a86e65b962a21eb9c033801a8711cb4f12f193
Reviewed-on: https://review.typo3.org/59047
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Daniel Goerz <daniel.goerz@posteo.de>
Tested-by: Daniel Goerz <daniel.goerz@posteo.de>
Reviewed-by: Mathias Brodala <mbrodala@pagemachine.de>
Tested-by: Mathias Brodala <mbrodala@pagemachine.de>
var timeVal = document.getElementById('preview_simulateDate-time-hr').value;
if (!dateVal && timeVal) {
var tempDate = new Date();
- dateVal = tempDate.getDate() + "-" + tempDate.getMonth() + "-" + tempDate.getFullYear();
+ dateVal = tempDate.getFullYear() + "-" + (tempDate.getMonth() + 1) + "-" + tempDate.getDate();
}
if (dateVal && !timeVal) {
timeVal = "00:00";