File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
core/src/components/datetime/utils Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -342,6 +342,17 @@ export const getMonthColumnData = (
342
342
return months ;
343
343
} ;
344
344
345
+ /**
346
+ * Returns information regarding
347
+ * selectable dates (i.e 1st, 2nd, 3rd, etc)
348
+ * within a reference month.
349
+ * @param locale The locale to format the date with
350
+ * @param refParts The reference month/year to generate dates for
351
+ * @param minParts The minimum bound on the date that can be returned
352
+ * @param maxParts The maximum bound on the date that can be returned
353
+ * @param dayValues The allowed date values
354
+ * @returns Date data to be used in ion-picker-column-internal
355
+ */
345
356
export const getDayColumnData = (
346
357
locale : string ,
347
358
refParts : DatetimeParts ,
@@ -352,6 +363,12 @@ export const getDayColumnData = (
352
363
const { month, year } = refParts ;
353
364
const days = [ ] ;
354
365
366
+ /**
367
+ * If we have max/min bounds that in the same
368
+ * month/year as the refParts, we should
369
+ * use the define day as the max/min day.
370
+ * Otherwise, fallback to the max/min days in a month.
371
+ */
355
372
const numDaysInMonth = getNumDaysInMonth ( month , year ) ;
356
373
const maxDay = maxParts ?. day && maxParts . year === year && maxParts . month === month ? maxParts . day : numDaysInMonth ;
357
374
const minDay = minParts ?. day && minParts . year === year && minParts . month === month ? minParts . day : 1 ;
You can’t perform that action at this time.
0 commit comments