Dashboard: powitanie dostosowane do pory dnia - wieczor i w nocy
This commit is contained in:
@@ -332,7 +332,13 @@ export default function Dashboard() {
|
||||
if (!data) return null;
|
||||
|
||||
const now = new Date();
|
||||
const greeting = now.getHours() >= 18 ? 'Dobry wieczór' : 'Dzień dobry';
|
||||
const hour = now.getHours();
|
||||
const greeting =
|
||||
hour >= 22 || hour < 6
|
||||
? 'Dobrej nocy'
|
||||
: hour >= 18
|
||||
? 'Dobry wieczór'
|
||||
: 'Dzień dobry';
|
||||
const dateLine = now.toLocaleDateString('pl-PL', {
|
||||
weekday: 'long',
|
||||
day: 'numeric',
|
||||
|
||||
Reference in New Issue
Block a user