File tree Expand file tree Collapse file tree 4 files changed +9
-7
lines changed Expand file tree Collapse file tree 4 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ Visit http://localhost:6006/
4848
4949``` typescript
5050
51+
5152onRangeSelect : (params : RangeParams ) => void
5253
5354type RangeParams = {
Original file line number Diff line number Diff line change 11{
22 "name" : " @viniarruda/react-month-range-picker" ,
3- "version" : " 2.0.1 " ,
3+ "version" : " 2.0.2 " ,
44 "author" : " Vinicius Arruda" ,
55 "description" : " React Month Range Picker" ,
66 "types" : " types/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -76,8 +76,9 @@ const TemplateTwoColumns: StoryFn<MonthRangePickerProps> = () => {
7676 < MonthRangePicker
7777 onRangeSelect = { onRangeSelect }
7878 columns = { 2 }
79- initialYear = { 2020 }
79+ initialYear = { 2023 }
8080 locale = "en-US"
81+ monthClassName = "month"
8182 />
8283 < h1 > Initial: { initialDate } </ h1 >
8384 < h1 > Final: { finalDate } </ h1 >
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ export const MonthRangePicker: React.FC<MonthRangePickerProps> = ({
8080 return (
8181 < Month
8282 key = { month }
83- className = { monthClassName }
83+ className = { ` ${ monthClassName } _ ${ getVariants ( ) } ` }
8484 justify = "center"
8585 disabled = { isDisabled }
8686 variant = { getVariants ( ) }
@@ -92,7 +92,7 @@ export const MonthRangePicker: React.FC<MonthRangePickerProps> = ({
9292 }
9393
9494 const renderYear = ( year : number ) => (
95- < Row wrap = "wrap" justify = "center" p = "4" css = { { gap : '4px 0' } } >
95+ < Row wrap = "wrap" justify = "center" p = "4" rowGap = "4" >
9696 { monthsNumber . map ( month => renderMonth ( year , month ) ) }
9797 </ Row >
9898 )
@@ -165,20 +165,20 @@ export const MonthRangePicker: React.FC<MonthRangePickerProps> = ({
165165 </ Arrow >
166166 < Flex mx = "4" >
167167 < Typography color = "secondary" size = "14" weight = "regular" >
168- { today . getFullYear ( ) + yearOffset }
168+ { initialYear + yearOffset }
169169 </ Typography >
170170 </ Flex >
171171 < Flex mx = "4" >
172172 < Typography color = "secondary" size = "14" weight = "regular" >
173- { today . getFullYear ( ) + yearOffset + 1 }
173+ { initialYear + yearOffset + 1 }
174174 </ Typography >
175175 </ Flex >
176176 < Arrow onClick = { handleNextYear } >
177177 < ChevronRight fill = "$textSecondary" fontSize = "$20" />
178178 </ Arrow >
179179 </ Row >
180180 < Flex gap = "4" >
181- { renderYear ( today . getFullYear ( ) + yearOffset ) }
181+ { renderYear ( initialYear + yearOffset ) }
182182 { renderYear ( today . getFullYear ( ) + yearOffset + 1 ) }
183183 </ Flex >
184184 </ Calender >
You can’t perform that action at this time.
0 commit comments