Is there a way to fire callbacks based on changes in the value of a DatePickerSingle object that do not constitute valid date values? The idea would be to feed the invalid date value to a custom parser that would return a valid date value; that valid date value would then be posted to the date attribute of the DatePickerSingle object with the goal of continuing the usual callback chain that would occur if a valid date had been supplied to DatePickerSingle in the first instance. The specific use case I have in mind is m/dd/yyyy (which DatePickerSingle seems to consider invalid, as opposed to mm/dd/yyyy), but there may be other formats for which adding custom date parsing would be useful. The alternative that comes to mind is to supply a second input box next to DatePickerSingle, use both the second input box and DatePickerSingle as inputs for relevant callbacks, and dash’s callback_context to determine which object, if any, has a new value, but I think this approach is rather inelegant.
Here is what I have tried so far:
Trying to use the “value” attribute of the DatePickerSingle object rather than the “date” attribute to trigger the callback.
Trying to use the “value” attribute of the object whose id is “date,” which seems to be the id of the text field created by dcc.DatePickerSingle, to trigger the callback.
Trying to use various attribute names of the object whose id is “date,” including “DateInput_input.value,” “DateInput_input_1.value,” “DateInput_input__focused.value,” “DateInput_input__focused_2.value” and other related permutations (e.g., DateInput, DateInput_1), to trigger the callback.
Trying to use the “value” attribute of an object identified by various permutations of “DateInput_input,” “DateInput_input_1,” “DateInput_input__focused,” and “DateInput_input__focused_2” to trigeer the callback.
In each case, however, the callback does not fire.
Sorry if this question has been asked before, but I didn’t get any relevant hits when I searched the forums for search terms like “datepicker” combined with “flexible format” and “allow invalid,” nor did I see anything on point in the first few pages of results for “datepicker.”