Actions

MediaWiki

Common.js: Difference between revisions

From hmis

No edit summary
Tag: Reverted
No edit summary
Tag: Manual revert
 
(2 intermediate revisions by the same user not shown)
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
var dateTimeInput = new mw.widgets.datetime.DateTimeInputWidget({
    // Configuration options can go here
    type: 'datetime', // Can be 'date', 'time', or 'datetime'
    // Other options like 'utc' (boolean) or 'timezone' (string)
});
// Append the widget to an element in your HTML form
$( 'body' ).append( dateTimeInput.$element );
// Accessing the value
dateTimeInput.on( 'change', function () {
    var dateValue = dateTimeInput.getValue();
    console.log( 'Selected date and time: ' + dateValue );
});

Latest revision as of 13:25, November 4, 2025

/* Any JavaScript here will be loaded for all users on every page load. */