630
edits
No edit summary |
m (Use DateInput) |
||
Line 2: | Line 2: | ||
$(function() { | $(function() { | ||
$('#ir-roman-date-converter'). | let dateInput = new mw.widgets.DateInputWidget({id: 'date'}); | ||
$('#ir-roman-date-converter').append(dateInput.$element); | |||
$('#ir-roman-date-converter').append('<div class=\"mw-inputbox-centered\"> \ | |||
<input type=\"submit\" onclick=\"submit()\" class=\"mw-ui-button mw-ui-progressive webfonts-changed\" value=\"Convert Date\"> \ | <input type=\"submit\" onclick=\"submit()\" class=\"mw-ui-button mw-ui-progressive webfonts-changed\" value=\"Convert Date\"> \ | ||
<div id=\"result\"></div> \ | <div id=\"result\"></div> \ | ||
Line 10: | Line 11: | ||
const resultDiv = document.getElementById(\"result\"); \ | const resultDiv = document.getElementById(\"result\"); \ | ||
const api = new mw.Api(); \ | const api = new mw.Api(); \ | ||
let date = | let date = $(#date).getValue(); \ | ||
api.get({ \ | api.get({ \ | ||
action: \'expandtemplates\', \ | action: \'expandtemplates\', \ |