Common.js: Difference between revisions
From hmis
No edit summary Tag: Reverted |
No edit summary Tag: Reverted |
||
| Line 1: | Line 1: | ||
/* Any JavaScript here will be loaded for all users on every page load. */ | /* Any JavaScript here will be loaded for all users on every page load. */ | ||
// Example of a DateTimeInputWidget | // Example of a DateTimeInputWidget | ||
// Convert Page Forms text fields with class 'datetime-local' into HTML5 datetime-local pickers | |||
mw.hook('pf.formReady').add(function () { | |||
document.querySelectorAll('input.datetime-local').forEach(el => { | |||
el.setAttribute('type', 'datetime-local'); | |||
}); | |||
}); | }); | ||
Revision as of 08:57, November 4, 2025
/* Any JavaScript here will be loaded for all users on every page load. */
// Example of a DateTimeInputWidget
// Convert Page Forms text fields with class 'datetime-local' into HTML5 datetime-local pickers
mw.hook('pf.formReady').add(function () {
document.querySelectorAll('input.datetime-local').forEach(el => {
el.setAttribute('type', 'datetime-local');
});
});