fix(SW-649): remove superfluous variable

This commit is contained in:
Chuma McPhoy
2024-10-29 12:50:45 +01:00
parent aa20c3569b
commit 6a31aca0b1

View File

@@ -56,7 +56,6 @@ export default function DateSelect({ name, registerOptions = {} }: DateProps) {
.reverse()
.map((year) => ({ value: year, label: year.toString() }))
// Get max days based on selected month/year
const daysInMonth =
selectedMonth !== null && selectedYear !== null
? dt(`${selectedYear}-${selectedMonth + 1}-01`).daysInMonth()
@@ -82,8 +81,7 @@ export default function DateSelect({ name, registerOptions = {} }: DateProps) {
* must subtract by 1 to get the selected month
*/
case DateName.month:
const monthZeroBased = value - 1
newMonth = monthZeroBased
newMonth = value - 1
setSelectedMonth(newMonth)
if (selectedDay) {
const maxDays = dt(`${newYear}-${value}-01`).daysInMonth()