Merge branch 'fix-datepicker' into 'develop'
Datepicker: correctly default to the current year See merge request soapbox-pub/soapbox!2104
This commit is contained in:
commit
393928a5c7
2 changed files with 2 additions and 1 deletions
|
@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
### Fixed
|
### Fixed
|
||||||
- Layout: use accent color for "floating action button" (mobile compose button).
|
- Layout: use accent color for "floating action button" (mobile compose button).
|
||||||
- ServiceWorker: don't serve favicon, robots.txt, and others from ServiceWorker.
|
- ServiceWorker: don't serve favicon, robots.txt, and others from ServiceWorker.
|
||||||
|
- Datepicker: correctly default to the current year.
|
||||||
|
|
||||||
## [3.0.0] - 2022-12-25
|
## [3.0.0] - 2022-12-25
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ const Datepicker = ({ onChange }: IDatepicker) => {
|
||||||
|
|
||||||
const [month, setMonth] = useState<number>(new Date().getMonth());
|
const [month, setMonth] = useState<number>(new Date().getMonth());
|
||||||
const [day, setDay] = useState<number>(new Date().getDate());
|
const [day, setDay] = useState<number>(new Date().getDate());
|
||||||
const [year, setYear] = useState<number>(2022);
|
const [year, setYear] = useState<number>(new Date().getFullYear());
|
||||||
|
|
||||||
const numberOfDays = useMemo(() => {
|
const numberOfDays = useMemo(() => {
|
||||||
return getDaysInMonth(month, year);
|
return getDaysInMonth(month, year);
|
||||||
|
|
Loading…
Reference in a new issue