feat: refactor daily task management with new pending tasks section
- Added `PendingTasksSection` to `DailyPageClient` for displaying uncompleted tasks. - Implemented `getPendingCheckboxes` method in `DailyClient` and `DailyService` to fetch pending tasks. - Introduced `getDaysAgo` utility function for calculating elapsed days since a date. - Updated `TODO.md` to reflect the new task management features and adjustments. - Cleaned up and organized folder structure to align with Next.js 13+ best practices.
This commit is contained in:
@@ -63,6 +63,15 @@ export function formatDateShort(date: Date): string {
|
||||
return formatDateForDisplay(date, 'DISPLAY_SHORT');
|
||||
}
|
||||
|
||||
/**
|
||||
* Calcule le nombre de jours écoulés depuis une date
|
||||
*/
|
||||
export function getDaysAgo(date: Date): number {
|
||||
const today = getToday();
|
||||
const diffTime = today.getTime() - normalizeDate(date).getTime();
|
||||
return Math.floor(diffTime / (1000 * 60 * 60 * 24));
|
||||
}
|
||||
|
||||
/**
|
||||
* Formate une date longue pour l'affichage (lundi 1 décembre 2025)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user