Add a widget to display the current date alongside weather information

Introduce a new DateWidget component, integrated into the main layout to display the current date, and refactor WeatherWidget to remove redundant date formatting.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: d43bd811-9372-45a7-8ac9-4a954c0538e1
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/d43bd811-9372-45a7-8ac9-4a954c0538e1/dB3dp7l
This commit is contained in:
michaelschal committed 2025-08-15 08:48:58 +00:00
1 parent 7a083a0203
commit 369638f3d6
3 files changed
+41 -13

No files matched your search

+1 -11
View File
@@ -21,14 +21,7 @@ interface WeatherResponse {
location: string;
}
const formatDate = (date: Date): string => {
return date.toLocaleDateString('fr-FR', {
weekday: 'long',
year: 'numeric',
month: 'long',
day: 'numeric'
});
};
const WeatherIcon = ({ condition, size = 20 }: { condition: string; size?: number }) => {
const iconClass = `h-${Math.floor(size/4)} w-${Math.floor(size/4)}`;
@@ -128,9 +121,6 @@ export default function WeatherWidget() {
<span className="text-xs text-slate-500 dark:text-slate-400">
{weather.currentYear?.condition || 'Inconnu'}
</span>
<span className="text-xs text-slate-400 dark:text-slate-500 mt-1">
{formatDate(new Date())}
</span>
</div>
</div>