)
}
\ No newline at end of file
diff --git a/src/components/SingleDatePicker.tsx b/src/components/SingleDatePicker.tsx
index b379cbe..0d24d4e 100644
--- a/src/components/SingleDatePicker.tsx
+++ b/src/components/SingleDatePicker.tsx
@@ -3,14 +3,14 @@ import { getCalendarDates, getL10Weekday, generateUniqueId, applyColor } from '.
export interface SingleDatePickerProps {
/**
- * Control the selected
+ * Control the selected
* date programmatically, including situations like provide a default value or control the selected
* date by parent component. Use 1-12 for month, instead of 0-11, if you are using object to set the
* value.
* @example { year: 2025, month: 1, day: 1 }
* @example new Date(2025, 0, 1)
* @default new Date()
- */
+ */
value?: Date | { year: number, month: number, day: number }
/**
@@ -97,11 +97,11 @@ const SingleDatePicker: React.FC = ({ value, onSelect, lo
if (!value) return
if (!(value instanceof Date)) {
if (value.year < 100) value.year = Number(`20${value.year}`)
- if (value.month < 0 || value.month > 11)
+ if (value.month < 0 || value.month > 11)
return console.warn('Invalid value: Month should be between 1 and 12.')
if (value.day < 1 || value.day > 31)
return console.warn('Invalid value: Day should be between 1 and 31.')
- }
+ }
const date = value instanceof Date ? value : new Date(value.year, value.month - 1, value.day)
setSelectedDate(date)
setCurrentMonth(date.getMonth())
@@ -121,7 +121,7 @@ const SingleDatePicker: React.FC = ({ value, onSelect, lo
hoverColor: hoverColor,
borderColor: borderColor
})
- } , [mainColor, accentColor, reversedColor, hoverColor, borderColor])
+ }, [mainColor, accentColor, reversedColor, hoverColor, borderColor])
function selectDate(date: Date) {
setSelectedDate(date)
@@ -175,15 +175,17 @@ const SingleDatePicker: React.FC = ({ value, onSelect, lo
setCurrentYear(currentYear + 1)
}} aria-label={`Go to next year, ${currentYear + 1}, you are now at year ${currentYear}`}>
-