(
refParts: DatetimeParts,
{
minParts,
maxParts,
}: {
minParts?: DatetimeParts;
maxParts?: DatetimeParts;
}
)
| 139 | * current date value and min/max date constraints. |
| 140 | */ |
| 141 | export const isMonthDisabled = ( |
| 142 | refParts: DatetimeParts, |
| 143 | { |
| 144 | minParts, |
| 145 | maxParts, |
| 146 | }: { |
| 147 | minParts?: DatetimeParts; |
| 148 | maxParts?: DatetimeParts; |
| 149 | } |
| 150 | ) => { |
| 151 | // If the year is disabled then the month is disabled. |
| 152 | if (isYearDisabled(refParts.year, minParts, maxParts)) { |
| 153 | return true; |
| 154 | } |
| 155 | // If the date value is before the min date, then the month is disabled. |
| 156 | // If the date value is after the max date, then the month is disabled. |
| 157 | if ((minParts && isBefore(refParts, minParts)) || (maxParts && isAfter(refParts, maxParts))) { |
| 158 | return true; |
| 159 | } |
| 160 | return false; |
| 161 | }; |
| 162 | |
| 163 | /** |
| 164 | * Given a working date, an optional minimum date range, |
no test coverage detected