From 1f616c0a44f696454dc8b21b76d91c9bf645f4a8 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sun, 1 Jan 2023 00:15:37 -0600 Subject: [PATCH] Datepicker: correctly default to the current year --- CHANGELOG.md | 1 + app/soapbox/components/ui/datepicker/datepicker.tsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 490404721..05162696f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Layout: use accent color for "floating action button" (mobile compose button). - ServiceWorker: don't serve favicon, robots.txt, and others from ServiceWorker. +- Datepicker: correctly default to the current year. ## [3.0.0] - 2022-12-25 diff --git a/app/soapbox/components/ui/datepicker/datepicker.tsx b/app/soapbox/components/ui/datepicker/datepicker.tsx index 3c3c9b8e2..bef846709 100644 --- a/app/soapbox/components/ui/datepicker/datepicker.tsx +++ b/app/soapbox/components/ui/datepicker/datepicker.tsx @@ -20,7 +20,7 @@ const Datepicker = ({ onChange }: IDatepicker) => { const [month, setMonth] = useState(new Date().getMonth()); const [day, setDay] = useState(new Date().getDate()); - const [year, setYear] = useState(2022); + const [year, setYear] = useState(new Date().getFullYear()); const numberOfDays = useMemo(() => { return getDaysInMonth(month, year);