How to update TimePicker programmatically


Topic: How to update TimePicker programmatically

qweluke asked 2 years ago

Expected behavior How to update TimePicker value programmatically?

Actual behavior If I use code below nothing happend even that console.log in render method shows valid hour. TimePicker still shows 0

Resources (screenshots, code snippets etc.)

<MDBTimePicker id="shiftStart"
        hoursFormat={24}
        autoSwitch={true}
        hours={shiftTypeForm.id ? parseInt(moment(shiftTypeForm.shiftStart, 'HH:mm').format('HH'), 10) : 0}
        minutes={shiftTypeForm.id ? parseInt(moment(shiftTypeForm.shiftStart, 'HH:mm').format('mm'), 10) : 0}
        label="Shift start" getValue={this.getPickerValue} />

Jakub Mandra staff premium answered 2 years ago

Hi,

We are aware of the problem. TimePicker was meant to watch for hours and minutes properties only on mount, but it will be upgraded as soon as possible.

Best,

Jakub


Please insert min. 20 characters.
Status

Answered

Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: React
  • MDB Version: 4.11.0
  • Device: MacBook pro
  • Browser: Chrome
  • OS: MacOS
  • Provided sample code: No
  • Provided link: No