fix(SW-649): remove superfluous variable
This commit is contained in:
@@ -56,7 +56,6 @@ export default function DateSelect({ name, registerOptions = {} }: DateProps) {
|
|||||||
.reverse()
|
.reverse()
|
||||||
.map((year) => ({ value: year, label: year.toString() }))
|
.map((year) => ({ value: year, label: year.toString() }))
|
||||||
|
|
||||||
// Get max days based on selected month/year
|
|
||||||
const daysInMonth =
|
const daysInMonth =
|
||||||
selectedMonth !== null && selectedYear !== null
|
selectedMonth !== null && selectedYear !== null
|
||||||
? dt(`${selectedYear}-${selectedMonth + 1}-01`).daysInMonth()
|
? 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
|
* must subtract by 1 to get the selected month
|
||||||
*/
|
*/
|
||||||
case DateName.month:
|
case DateName.month:
|
||||||
const monthZeroBased = value - 1
|
newMonth = value - 1
|
||||||
newMonth = monthZeroBased
|
|
||||||
setSelectedMonth(newMonth)
|
setSelectedMonth(newMonth)
|
||||||
if (selectedDay) {
|
if (selectedDay) {
|
||||||
const maxDays = dt(`${newYear}-${value}-01`).daysInMonth()
|
const maxDays = dt(`${newYear}-${value}-01`).daysInMonth()
|
||||||
|
|||||||
Reference in New Issue
Block a user