mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-13 08:13:49 +10:00
fix(client): 🐛 attempt to fix the one-off date issue
use utc functions from dayjs to correspond to the same date on the server
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import dayjs from 'dayjs';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
import utc from 'dayjs/plugin/utc';
|
||||
import { useRouter } from 'next/router';
|
||||
import { useEffect } from 'react';
|
||||
|
||||
@ -7,6 +8,7 @@ const DateWrapper: React.FC<React.PropsWithChildren<unknown>> = ({ children }) =
|
||||
const { locale } = useRouter();
|
||||
|
||||
useEffect(() => {
|
||||
dayjs.extend(utc);
|
||||
dayjs.extend(relativeTime);
|
||||
|
||||
// Locales
|
||||
|
||||
Reference in New Issue
Block a user