Can't clear the date once picked
I'm trying to clear the date once a user clicks on a clear button to clear all filters for a report but irrespective of what I set the model value to be, the date always remains the same as what was previously picked.
Example:
this.filters.from = null; <-- has no effect on the selected date
What is the correct procedure for resetting the date picker?
@dwqs - also stuck on how this works - it's not in the documentation by the way. Any help is much appreciated. Thank you.
Found this out. To manually trigger reset, we need to use clearDate(). It's just that it's not in the documentation because there's an existing element (part of the datepicker) that resets the value.
Nevertheless, if value is empty, it throws a console error.
TypeError: Cannot read property '$emit' of null
@mattyglover manually you can clear this by calling clearDate() method.
Example:
this is the component-
<v2-datepicker-range ref="dateRangePicker"></v2-datepicker-range>
now call this from your function-
this.$refs.dateRangePicker.clearDate();