File tree Expand file tree Collapse file tree 2 files changed +6
-14
lines changed
Expand file tree Collapse file tree 2 files changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -95,11 +95,11 @@ describe("Hijri DayPicker", () => {
9595 expect ( nextButton ( ) ) . toHaveAttribute ( "aria-disabled" , "true" ) ;
9696 } ) ;
9797
98- test ( "clamps deprecated fromMonth below range" , ( ) => {
98+ test ( "clamps startMonth below range" , ( ) => {
9999 render (
100100 < DayPicker
101101 month = { gregorianMinDate }
102- fromMonth = { new Date ( 1900 , 0 , 1 ) }
102+ startMonth = { new Date ( 1900 , 0 , 1 ) }
103103 locale = { enUS }
104104 dir = "ltr"
105105 numerals = "latn"
@@ -109,11 +109,11 @@ describe("Hijri DayPicker", () => {
109109 expect ( previousButton ( ) ) . toHaveAttribute ( "aria-disabled" , "true" ) ;
110110 } ) ;
111111
112- test ( "clamps deprecated toMonth above range" , ( ) => {
112+ test ( "clamps endMonth above range" , ( ) => {
113113 render (
114114 < DayPicker
115115 month = { gregorianMaxDate }
116- toMonth = { new Date ( 2100 , 0 , 1 ) }
116+ endMonth = { new Date ( 2100 , 0 , 1 ) }
117117 locale = { enUS }
118118 dir = "ltr"
119119 numerals = "latn"
Original file line number Diff line number Diff line change @@ -44,14 +44,8 @@ export function DayPicker(
4444 } ,
4545) {
4646 const { dateLib : dateLibProp , ...dayPickerProps } = props ;
47- const hasStartBound =
48- props . startMonth !== undefined ||
49- props . fromMonth !== undefined ||
50- props . fromYear !== undefined ;
51- const hasEndBound =
52- props . endMonth !== undefined ||
53- props . toMonth !== undefined ||
54- props . toYear !== undefined ;
47+ const hasStartBound = props . startMonth !== undefined ;
48+ const hasEndBound = props . endMonth !== undefined ;
5549
5650 const clampedProps : typeof dayPickerProps = {
5751 ...dayPickerProps ,
@@ -64,8 +58,6 @@ export function DayPicker(
6458 endMonth : hasEndBound
6559 ? clampDateProp ( props . endMonth )
6660 : new Date ( GREGORIAN_MAX_DATE ) ,
67- fromMonth : clampDateProp ( props . fromMonth ) ,
68- toMonth : clampDateProp ( props . toMonth ) ,
6961 } ;
7062
7163 return (
You can’t perform that action at this time.
0 commit comments