Calendar V3
This commit is contained in:
@@ -66,12 +66,12 @@
|
||||
html += '<div class="luxtools-event-popup-field">';
|
||||
if (allDay) {
|
||||
html += '<strong>Date:</strong> ' + formatDate(start);
|
||||
if (end) {
|
||||
if (end && !isSameMoment(start, end)) {
|
||||
html += ' – ' + formatDate(end);
|
||||
}
|
||||
} else {
|
||||
html += '<strong>Time:</strong> ' + formatDateTime(start);
|
||||
if (end) {
|
||||
if (end && !isSameMoment(start, end)) {
|
||||
html += ' – ' + formatDateTime(end);
|
||||
}
|
||||
}
|
||||
@@ -114,14 +114,23 @@
|
||||
if (!isoStr) return '';
|
||||
var d = new Date(isoStr);
|
||||
if (isNaN(d.getTime())) return isoStr;
|
||||
return d.toLocaleDateString();
|
||||
return pad2(d.getDate()) + '.' + pad2(d.getMonth() + 1) + '.' + d.getFullYear();
|
||||
}
|
||||
|
||||
function formatDateTime(isoStr) {
|
||||
if (!isoStr) return '';
|
||||
var d = new Date(isoStr);
|
||||
if (isNaN(d.getTime())) return isoStr;
|
||||
return d.toLocaleDateString() + ' ' + d.toLocaleTimeString(undefined, { hour: '2-digit', minute: '2-digit' });
|
||||
return formatDate(isoStr) + ' ' + pad2(d.getHours()) + ':' + pad2(d.getMinutes());
|
||||
}
|
||||
|
||||
function isSameMoment(left, right) {
|
||||
if (!left || !right) return false;
|
||||
return left === right;
|
||||
}
|
||||
|
||||
function pad2(value) {
|
||||
return String(value).padStart(2, '0');
|
||||
}
|
||||
|
||||
function escapeHtml(text) {
|
||||
@@ -198,11 +207,9 @@
|
||||
// Visual feedback: mark item as done or revert
|
||||
if (action === 'complete') {
|
||||
item.classList.add('luxtools-task-completed');
|
||||
// Fade out and remove after a short delay
|
||||
item.style.opacity = '0.5';
|
||||
setTimeout(function () {
|
||||
item.style.display = 'none';
|
||||
}, 1000);
|
||||
button.textContent = 'Reopen';
|
||||
button.setAttribute('data-action', 'reopen');
|
||||
button.disabled = false;
|
||||
} else {
|
||||
item.classList.remove('luxtools-task-completed');
|
||||
item.style.opacity = '1';
|
||||
|
||||
Reference in New Issue
Block a user