Implement API endpoints and frontend components for creating and managing timesheets, projects, and dashboard functionalities. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 55837015-10e9-4be9-b857-7f5e6be73772 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: e5763354-5d83-482b-a89e-394e3eb5a41e Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1cc377db-7ea0-49f2-97ce-c3e87e0228cc/55837015-10e9-4be9-b857-7f5e6be73772/JpyvMwJ Replit-Helium-Checkpoint-Created: true
45 lines
1.3 KiB
TypeScript
45 lines
1.3 KiB
TypeScript
import { clsx, type ClassValue } from "clsx"
|
|
import { twMerge } from "tailwind-merge"
|
|
import { format, parseISO } from "date-fns"
|
|
import { fr } from "date-fns/locale"
|
|
|
|
export function cn(...inputs: ClassValue[]) {
|
|
return twMerge(clsx(inputs))
|
|
}
|
|
|
|
export function formatMonthYear(year: number, month: number) {
|
|
const date = new Date(year, month - 1);
|
|
return format(date, "MMMM yyyy", { locale: fr });
|
|
}
|
|
|
|
export function formatDateFr(dateString: string) {
|
|
return format(parseISO(dateString), "dd MMM yyyy", { locale: fr });
|
|
}
|
|
|
|
export const MONTHS = [
|
|
{ value: 1, label: "Janvier" },
|
|
{ value: 2, label: "Février" },
|
|
{ value: 3, label: "Mars" },
|
|
{ value: 4, label: "Avril" },
|
|
{ value: 5, label: "Mai" },
|
|
{ value: 6, label: "Juin" },
|
|
{ value: 7, label: "Juillet" },
|
|
{ value: 8, label: "Août" },
|
|
{ value: 9, label: "Septembre" },
|
|
{ value: 10, label: "Octobre" },
|
|
{ value: 11, label: "Novembre" },
|
|
{ value: 12, label: "Décembre" },
|
|
];
|
|
|
|
export const STATUS_LABELS: Record<string, string> = {
|
|
draft: "Brouillon",
|
|
submitted: "Soumis",
|
|
validated: "Validé"
|
|
};
|
|
|
|
export const STATUS_COLORS: Record<string, string> = {
|
|
draft: "bg-muted text-muted-foreground",
|
|
submitted: "bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-300",
|
|
validated: "bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-300"
|
|
};
|