The documentation of the onchange event says this:
This event is triggered when there is a change detected.
return confirm(“Are you sure you want to change date?”)
Which sort of implies that if the user answers “No” the date will not change. However, the date seems to be changed before the onChange callback is called and regardless of the return the date is not changed.