MCPcopy Index your code
hub / github.com/ionic-team/ionic-framework / isMonthDisabled

Function isMonthDisabled

core/src/components/datetime/utils/state.ts:141–161  ·  view source on GitHub ↗
(
  refParts: DatetimeParts,
  {
    minParts,
    maxParts,
  }: {
    minParts?: DatetimeParts;
    maxParts?: DatetimeParts;
  }
)

Source from the content-addressed store, hash-verified

139 * current date value and min/max date constraints.
140 */
141export 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,

Callers 4

updateActiveMonthMethod · 0.90
renderMonthMethod · 0.90
isPrevMonthDisabledFunction · 0.85
isNextMonthDisabledFunction · 0.85

Calls 3

isBeforeFunction · 0.90
isAfterFunction · 0.90
isYearDisabledFunction · 0.85

Tested by

no test coverage detected