feat: Update assets and improve code comments across multiple components

- Updated favicon and various image assets.
- Enhanced comments.
- Adjusted styles and functionality in several components for improved user experience.
- Updated package-lock.json to reflect dependency updates.
This commit is contained in:
2026-02-06 12:56:34 +01:00
parent 7a6a7f5d35
commit 7c8ef45e5a
36 changed files with 325 additions and 317 deletions

View File

@@ -1,9 +1,9 @@
import { DateType } from "react-native-ui-datepicker";
/**
* Trasforma una data da "YYYY-MM-DD" a "DD/MM/YYYY"
* @param dateStr stringa data in formato ISO "YYYY-MM-DD"
* @returns stringa formattata "DD/MM/YYYY"
* Transforms "YYYY-MM-DD" to "DD/MM/YYYY"
* @param dateStr string in ISO date format "YYYY-MM-DD"
* @returns formatted string "DD/MM/YYYY"
*/
export const formatDate = (dateStr: string | null | undefined): string => {
if (!dateStr) return '';
@@ -12,9 +12,9 @@ export const formatDate = (dateStr: string | null | undefined): string => {
};
/**
* Trasforma un'ora da "HH:MM:SS" a "HH:MM"
* @param timeStr stringa ora in formato "HH:MM:SS"
* @returns stringa formattata "HH:MM"
* Transforms time from "HH:MM:SS" to "HH:MM"
* @param timeStr string in time format "HH:MM:SS"
* @returns formatted string "HH:MM"
*/
export const formatTime = (timeStr: string | null | undefined): string => {
if (!timeStr) return '';
@@ -23,9 +23,9 @@ export const formatTime = (timeStr: string | null | undefined): string => {
};
/**
* Formatta una data per l'uso con un date picker, normalizzandola a mezzanotte
* @param d Data in formato DateType
* @returns stringa data in formato "YYYY-MM-DD" o null se l'input è null/undefined
* Formats a date for use with a date picker, normalizing it to midnight
* @param d Date in DateType format
* @returns string in "YYYY-MM-DD" format or null if input is null/undefined
*/
export const formatPickerDate = (d: DateType | null | undefined) => {
if (!d) return null;
@@ -41,9 +41,9 @@ export const formatPickerDate = (d: DateType | null | undefined) => {
}
/**
* Trasforma un timestamp in stringa "DD/MM/YYYY HH:mm:ss"
* @param timestamp stringa o oggetto Date
* @returns stringa formattata oppure vuota se input non valido
* Transforms a timestamp into a string "DD/MM/YYYY HH:mm:ss"
* @param timestamp string or Date object
* @returns formatted string or empty string if input is invalid
*/
export const formatTimestamp = (timestamp: string | Date | null | undefined): string => {
if (!timestamp) return '';
@@ -52,7 +52,7 @@ export const formatTimestamp = (timestamp: string | Date | null | undefined): st
if (isNaN(date.getTime())) return '';
const dd = String(date.getDate()).padStart(2, '0');
const mm = String(date.getMonth() + 1).padStart(2, '0'); // mesi da 0 a 11
const mm = String(date.getMonth() + 1).padStart(2, '0'); // months from 0 to 11
const yyyy = date.getFullYear();
const hh = String(date.getHours()).padStart(2, '0');
@@ -63,9 +63,9 @@ export const formatTimestamp = (timestamp: string | Date | null | undefined): st
};
/**
* Converte un timestamp ISO in oggetto Date
* @param dateStr stringa data in formato ISO
* @returns oggetto Date corrispondente
* Converts an ISO timestamp to a Date object
* @param dateStr string in ISO date format
* @returns corresponding Date object
*/
export const parseTimestamp = (dateStr: string | undefined | null): Date => {
if (!dateStr) return new Date();