mdb datepicker

jcarvalho pro premium priority asked 4 days ago

Expected behavior like to clear the selected date

Actual behavior the date is still highlighted in blue

Resources (screenshots, code snippets etc.) selected date in the date table is not resetting.
$('#mydate').val(''');enter image description here


jcarvalho pro premium priority commented 4 days ago

Could you please help to reset the highlighted date in Blue. mdb.Datepicker.getInstance(document.getElementById('mydate')).dispose(); mdb.Datepicker.getOrCreateInstance(document.getElementById('mydate')).update({'startDate' : null });

dispose and recreate did not work. Please help.


Kamila Pieńkowska staff answered 4 days ago

You should change the value in the input and then trigger the 'input' event with JS on the input element.

If it does not help please provide a snippet that recreates the issue. The startDate option does not equal selected date. It is a date that will visible when datepicker opens.


jcarvalho pro premium priority commented 4 days ago

Here is the examplelet ele = mdb.Datepicker.getOrCreateInstance(document.getElementById('myDate')); ele.value ='';

$("#myDate").val("").trigger("change");

both did not work.

Can you please provide sample?


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • User: Pro
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 6.4.1
  • Device: mac os
  • Browser: google chrome
  • OS: Mac Os
  • Provided sample code: No
  • Provided link: No