Resolution Steps:
During my search for a solution to the specific issue, I came across a helpful blog post. The blog post, which I found at https://debajmecrm.com/solved-typing-in-character-t-automatically-inserting-current-datetime-in-datepicker-controls-on-webforms-in-dynamics-365-powerapps-portals/.
However, the provided solution in the blog post didn't work for my case. Since the blog post was published in 2020, there's a possibility that the object structure has changed, making it challenging to access the required data and events to remove the event handlers. It's important to note that this limitation may also apply to newer solutions, as they could feature different object structures.
I attempted to find a solution that doesn't rely on the object's structure, aiming to avoid any dependence on static identifiers or names within it.
function removeDateTimePickerEventhandler(fieldName){
var dateTimePickerID = fieldName +"_datepicker_description";
// Find the DateTimePicker control using its ID
var $dateTimePicker = $('#' + dateTimePickerID);
// Get all 'keydown' event handlers attached to the DateTimePicker control
if( $._data!=undefined){
var keydownEventHandlers = $._data($dateTimePicker[0], "events").keydown;
// Iterate over the keydown event handlers and remove them
if (keydownEventHandlers) {
$.each(keydownEventHandlers, function(index, eventHandler) {
// Remove the event handler
$dateTimePicker.off('keydown', eventHandler.handler);
});
}
}
}