window.openDatePicker = function (element) {
    if (element) {
        const wasReadOnly = element.readOnly;
        if (wasReadOnly) element.readOnly = false;
        element.showPicker();
        if (wasReadOnly) setTimeout(() => element.readOnly = true, 0);
    }
};