Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
This commit is contained in:
Julien Veyssier 2019-04-30 11:47:41 +02:00
Родитель 9b4031d331
Коммит 6b2ed4ef37
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4141FEE162030638
1 изменённых файлов: 13 добавлений и 11 удалений

Просмотреть файл

@ -1463,21 +1463,23 @@
var isCurrentlyOpen = oh.getState();
var changeDt = oh.getNextChange();
var currentDt = new Date();
var dtDiff = changeDt.getTime() - currentDt.getTime();
dtDiff = dtDiff / 60000; // get diff in minutes
if (oh.getState()) { // is open?
desc += '<span class="poi-open">' + t('maps', 'Open') + '&nbsp;</span>';
if (dtDiff <= 60) {
desc += '<span class="poi-closes">,&nbsp;' + t('maps', 'closes in {nb} minutes', {nb: parseInt(dtDiff)}) + '</span>';
if (changeDt) {
var dtDiff = changeDt.getTime() - currentDt.getTime();
dtDiff = dtDiff / 60000; // get diff in minutes
if (isCurrentlyOpen) {
desc += '<span class="poi-open">' + t('maps', 'Open') + '&nbsp;</span>';
if (dtDiff <= 60) {
desc += '<span class="poi-closes">,&nbsp;' + t('maps', 'closes in {nb} minutes', {nb: parseInt(dtDiff)}) + '</span>';
}
else {
desc += '<span>&nbsp;' + t('maps', 'until {date}', {date: changeDt.toLocaleTimeString()}) + '</span>';
}
}
else {
desc += '<span>&nbsp;' + t('maps', 'until {date}', {date: changeDt.toLocaleTimeString()}) + '</span>';
desc += '<span class="poi-closed">' + t('maps', 'Closed') + '&nbsp;</span>';
desc += '<span class="poi-opens">' + t('maps', 'opens at {date}', {date: changeDt.toLocaleTimeString()}) + '</span>';
}
}
else {
desc += '<span class="poi-closed">' + t('maps', 'Closed') + '&nbsp;</span>';
desc += '<span class="poi-opens">' + t('maps', 'opens at {date}', {date: changeDt.toLocaleTimeString()}) + '</span>';
}
desc += '<img id="opening-hours-table-toggle-collapse" src="' +
OC.filePath('maps', 'img', 'triangle-s.svg') +
'" /><img id="opening-hours-table-toggle-expand" src="' +