Topic: Properly updating MDBDatePIcker CSS Styles
<MDBDatePicker style={{ width: '100%', color: '#0e9aa7' }} value={this.props.dashboard.ops.apiDate}
getValue={this.getValue} id='Opscalendar' format='DD MMMM, YYYY'
/>
Jakub Mandra
staff premium answered 2 years ago
theme prop to add your custm styles.
Here is a little snippet for you:
import React from 'react';
import { MDBDatePicker, Container } from 'mdbreact';
const theme = {
overrides: {
MuiPickersToolbar: {
toolbar: {
backgroundColor: 'black',
},
},
MuiPickersCalendarHeader: {
switchHeader: {
// backgroundColor: 'blue',
// color: 'blue',
},
},
MuiPickersDay: {
day: {
color: 'green',
},
selected: {
backgroundColor: 'blue',
},
current: {
color: 'blue',
},
},
MuiPickersModal: {
dialogAction: {
color: 'blue',
},
},
},
}
class DatePickerPage extends React.Component {
getPickerValue = (value) => {
console.log(value);
}
render() {
return(
<Container className="mt-5">
<MDBDatePicker getValue={this.getPickerValue} theme={theme} />
</Container>
);
}
};
export default DatePickerPage;
Resolved
- User: Pro
- Premium support: No
- Technology: React
- MDB Version: 4.7.1
- Device: All
- Browser: Major
- OS: Mac
- Provided sample code: No
- Provided link: Yes