mirror of
https://github.com/harivansh-afk/Habit-Tracker.git
synced 2026-04-15 05:02:10 +00:00
mobile version calendar page popup debug
This commit is contained in:
parent
8fd48a7740
commit
0da98e0344
1 changed files with 7 additions and 3 deletions
|
|
@ -159,13 +159,17 @@ export const Calendar: React.FC<CalendarProps> = ({
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// Update where dates are displayed
|
// Update the formatDisplayDate function to handle UTC dates correctly
|
||||||
const formatDisplayDate = (dateStr: string) => {
|
const formatDisplayDate = (dateStr: string) => {
|
||||||
const date = new Date(dateStr + 'T00:00:00.000Z');
|
// Create a UTC date from the ISO string
|
||||||
|
const [year, month, day] = dateStr.split('-').map(Number);
|
||||||
|
const date = new Date(Date.UTC(year, month - 1, day));
|
||||||
|
|
||||||
return date.toLocaleDateString('default', {
|
return date.toLocaleDateString('default', {
|
||||||
month: 'long',
|
month: 'long',
|
||||||
day: 'numeric',
|
day: 'numeric',
|
||||||
year: 'numeric'
|
year: 'numeric',
|
||||||
|
timeZone: 'UTC' // Ensure we use UTC timezone
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue