local-weather/utils/functions/weekday.ts
ChrQR 83b337db03
All checks were successful
Docker Build & Publish / Build Docker (push) Successful in 1m9s
Fixed for mobile?
2024-05-12 21:14:36 +02:00

6 lines
304 B
TypeScript

export default function weekday(date: string): string {
const newDate = new Date(date);
const dayNumber = newDate.getDay();
const weekdays = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
return weekdays[dayNumber]; // Directly return the weekday string
}