User:DAlangi (WMF)/common.js

/** Trying out MW DateInputWidget */ mw.loader.using(	'oojs-ui',	'oojs-ui-core',	'mediawiki.widgets.DateInputWidget' ).done( function {	var dateInput = new mw.widgets.DateInputWidget;	var $label = $( ' ' );	$( '#mw-content-text' ).append( $label, dateInput.$element );	dateInput.on( 'change', function  { // The value will always be a valid date or empty string, malformed input is ignored var date = dateInput.getValue; $label.text( 'Selected date: ' + ( date || '(none)' ) ); } ); } );