From 4c3d9e497cbb6d84a657ffe610fe2ec229daf036 Mon Sep 17 00:00:00 2001 From: Philip Halsall Date: Fri, 15 Nov 2024 13:20:22 +0800 Subject: [PATCH 1/2] adding getdate fn and using it to always have correct copyright date --- src/theme/Footer/index.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/theme/Footer/index.tsx b/src/theme/Footer/index.tsx index 26ce738ad..3c13b46d0 100644 --- a/src/theme/Footer/index.tsx +++ b/src/theme/Footer/index.tsx @@ -15,6 +15,12 @@ import WeChatLogo from '@site/static/svg/socials/wechat_24x24.svg'; import YoutubeLogo from '@site/static/svg/socials/youtube_24x24.svg'; import { FormSubmitUrl } from '@site/src/constants'; +function getCurrentYear(){ + const today = new Date(); + const year = today.getFullYear(); + return year; +} + function Footer(): JSX.Element | null { const [email, setEmail] = React.useState(''); const [isSubmitted, setIsSubmitted] = React.useState(false); @@ -230,7 +236,7 @@ function Footer(): JSX.Element | null {
- ©2023 Mina Foundation. All rights reserved. + ©{getCurrentYear()} Mina Foundation. All rights reserved.
From f26e68faeaceb8fcc3d03700551bee32e94edfad Mon Sep 17 00:00:00 2001 From: Philip Halsall Date: Mon, 18 Nov 2024 13:53:55 +0800 Subject: [PATCH 2/2] hardcoding the value to stop possible impact on performance --- src/theme/Footer/index.tsx | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/theme/Footer/index.tsx b/src/theme/Footer/index.tsx index 3c13b46d0..d0592efd1 100644 --- a/src/theme/Footer/index.tsx +++ b/src/theme/Footer/index.tsx @@ -15,12 +15,6 @@ import WeChatLogo from '@site/static/svg/socials/wechat_24x24.svg'; import YoutubeLogo from '@site/static/svg/socials/youtube_24x24.svg'; import { FormSubmitUrl } from '@site/src/constants'; -function getCurrentYear(){ - const today = new Date(); - const year = today.getFullYear(); - return year; -} - function Footer(): JSX.Element | null { const [email, setEmail] = React.useState(''); const [isSubmitted, setIsSubmitted] = React.useState(false); @@ -236,7 +230,7 @@ function Footer(): JSX.Element | null {
- ©{getCurrentYear()} Mina Foundation. All rights reserved. + ©2024 Mina Foundation. All rights reserved.