Primo commit

This commit is contained in:
2026-01-13 11:20:12 +01:00
parent ce9e2fdf2a
commit 17453f5d13
51 changed files with 3883 additions and 2508 deletions

View File

@@ -97,7 +97,7 @@ function formatDate(date) {
*/
function formatDateDisplay(dateStr) {
const date = new Date(dateStr + 'T12:00:00');
return date.toLocaleDateString('en-US', {
return date.toLocaleDateString('it-IT', {
weekday: 'short',
month: 'short',
day: 'numeric'
@@ -109,8 +109,8 @@ function formatDateDisplay(dateStr) {
*/
function getMonthName(month) {
const months = [
'January', 'February', 'March', 'April', 'May', 'June',
'July', 'August', 'September', 'October', 'November', 'December'
'Gennaio', 'Febbraio', 'Marzo', 'Aprile', 'Maggio', 'Giugno',
'Luglio', 'Agosto', 'Settembre', 'Ottobre', 'Novembre', 'Dicembre'
];
return months[month];
}
@@ -119,7 +119,7 @@ function getMonthName(month) {
* Get day name
*/
function getDayName(dayIndex) {
const days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
const days = ['Dom', 'Lun', 'Mar', 'Mer', 'Gio', 'Ven', 'Sab'];
return days[dayIndex];
}
@@ -133,7 +133,7 @@ function getDaysInMonth(year, month) {
/**
* Get start of week for a date
*/
function getWeekStart(date, weekStartDay = 0) {
function getWeekStart(date, weekStartDay = 1) {
const d = new Date(date);
const day = d.getDay();
const diff = (day - weekStartDay + 7) % 7;
@@ -146,7 +146,7 @@ function getWeekStart(date, weekStartDay = 0) {
* Format date as short display (e.g., "Nov 26")
*/
function formatDateShort(date) {
return date.toLocaleDateString('en-US', {
return date.toLocaleDateString('it-IT', {
month: 'short',
day: 'numeric'
});
@@ -163,12 +163,14 @@ function showMessage(message, type = 'success', duration = 3000) {
toastContainer.id = 'toastContainer';
toastContainer.style.cssText = `
position: fixed;
top: 1rem;
right: 1rem;
bottom: 2rem;
left: 50%;
transform: translateX(-50%);
z-index: 9999;
display: flex;
flex-direction: column;
gap: 0.5rem;
gap: 1rem;
align-items: center;
`;
document.body.appendChild(toastContainer);
}
@@ -176,17 +178,21 @@ function showMessage(message, type = 'success', duration = 3000) {
const toast = document.createElement('div');
toast.className = `message ${type}`;
toast.style.cssText = `
padding: 0.75rem 1rem;
border-radius: 6px;
box-shadow: 0 2px 8px rgba(0,0,0,0.15);
animation: slideIn 0.2s ease;
padding: 1rem 1.5rem;
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0,0,0,0.2);
animation: slideInBottom 0.3s ease;
font-size: 1.1rem;
font-weight: 500;
min-width: 300px;
text-align: center;
`;
toast.textContent = message;
toastContainer.appendChild(toast);
if (duration > 0) {
setTimeout(() => {
toast.style.animation = 'slideOut 0.2s ease';
toast.style.animation = 'fadeOut 0.3s ease';
setTimeout(() => toast.remove(), 200);
}, duration);
}
@@ -196,14 +202,7 @@ function showMessage(message, type = 'success', duration = 3000) {
* Close modal when clicking outside
*/
function setupModalClose(modalId) {
const modal = document.getElementById(modalId);
if (modal) {
modal.addEventListener('click', (e) => {
if (e.target.id === modalId) {
modal.style.display = 'none';
}
});
}
// Behavior disabled: clicking outside does not close modal
}
// Export utilities