From 74d1a5b5c30ed0d46dca22d2ce27b392d5689265 Mon Sep 17 00:00:00 2001 From: Kakabay <2kakabayashyrberdyew@gmail.com> Date: Wed, 8 Jan 2025 18:34:10 +0500 Subject: [PATCH] start date added to the lottery page --- components/common/InfoDateAllert.tsx | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 components/common/InfoDateAllert.tsx diff --git a/components/common/InfoDateAllert.tsx b/components/common/InfoDateAllert.tsx new file mode 100644 index 0000000..906aae0 --- /dev/null +++ b/components/common/InfoDateAllert.tsx @@ -0,0 +1,23 @@ +interface IProps { + text: string; + date: string; +} + +const InfoDateAllert = ({ text, date }: IProps) => { + function formatDate(dateTimeString: string) { + const [datePart] = dateTimeString.split(' '); + const [year, month, day] = datePart.split('-'); + return `${day}-${month}-${year}`; + } + + const readyDate = formatDate(date); + + return ( +