File tree Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 133
133
color : #f00 ;
134
134
}
135
135
136
+ .react-datepicker__week.highlighted {
137
+ background-color : #ddffdd ;
138
+ border-radius : 5px ;
139
+ }
140
+
136
141
.example-custom-input {
137
142
cursor : pointer ;
138
143
padding : 5px 15px ;
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ import CustomDateFormat from "../../examples/customDateFormat?raw";
18
18
import CustomClassName from "../../examples/customClassName?raw" ;
19
19
import CustomCalendarClassName from "../../examples/customCalendarClassName?raw" ;
20
20
import CustomDayClassName from "../../examples/customDayClassName?raw" ;
21
+ import CustomWeekClassName from "../../examples/customWeekClassName?raw" ;
21
22
import CustomTimeClassName from "../../examples/customTimeClassName?raw" ;
22
23
import Today from "../../examples/today?raw" ;
23
24
import PlaceholderText from "../../examples/placeholderText?raw" ;
@@ -222,6 +223,10 @@ export default class exampleComponents extends React.Component {
222
223
title : "Custom day class name" ,
223
224
component : CustomDayClassName ,
224
225
} ,
226
+ {
227
+ title : "Custom week class name" ,
228
+ component : CustomWeekClassName ,
229
+ } ,
225
230
{
226
231
title : "Custom date format" ,
227
232
component : CustomDateFormat ,
Original file line number Diff line number Diff line change
1
+ ( ) => {
2
+ const [ selectedDate , setSelectedDate ] = useState ( new Date ( ) ) ;
3
+ return (
4
+ < DatePicker
5
+ selected = { selectedDate }
6
+ onChange = { ( date ) => setSelectedDate ( date ) }
7
+ weekClassName = { ( date ) =>
8
+ getDate ( date ) % 2 === 0 ? "highlighted" : undefined
9
+ }
10
+ />
11
+ ) ;
12
+ } ;
You can’t perform that action at this time.
0 commit comments