Skip to content

Commit

Permalink
EDSC-4125 cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-zamora committed Dec 4, 2024
1 parent 5dbb3d5 commit cf5a966
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
16 changes: 8 additions & 8 deletions static/src/js/components/Datepicker/Datepicker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ class Datepicker extends PureComponent {
}

componentDidMount() {
const { onTodayClick, onClearClick } = this.props
const {
onTodayClick,
onClearClick
} = this.props

// Add a custom set of "Today" and "Clear" buttons and insert them into the picker
const container = this.containerRef.current?.querySelector('.rdtPicker')
Expand Down Expand Up @@ -63,20 +66,17 @@ class Datepicker extends PureComponent {
}

componentDidUpdate(prevProps) {
const { viewMode, picker } = this.props
const {
viewMode,
picker
} = this.props

// If the viewMode has changed, navigate to the new viewMode
if (prevProps.viewMode !== viewMode) {
picker.current.navigate(viewMode)
}
}

componentWillUnmount() {
if (this.updateTimeout) {
clearTimeout(this.updateTimeout)
}
}

onInputChange = (event) => {
const caret = event.target.selectionStart
const element = event.target
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ describe('TemporalSelection component', () => {

// Verify onChangeRecurring was called only once with the new range
expect(props.onChangeRecurring).toHaveBeenCalledTimes(1)
expect(props.setFieldValue).toHaveBeenCalledTimes(2)
expect(props.onChangeRecurring).toHaveBeenCalledWith({
min: 2018,
max: 2021
Expand Down

0 comments on commit cf5a966

Please sign in to comment.