MediaWiki:Common.js: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 7: | Line 7: | ||
var $counterItem = $( '<li>' ) | var $counterItem = $( '<li>' ) | ||
.attr( 'id', 'mw-custom-sidebar-counter' ) | .attr( 'id', 'mw-custom-sidebar-counter' ) | ||
.attr( 'class', 'mw-list-item') | .attr( 'class', 'mw-list-item') | ||
.text( daysSince ); | .text( daysSince ); | ||
$( '#p-Days_Since_Mikush_Disappeared ul' ).append( $counterItem ); | $( '#p-Days_Since_Mikush_Disappeared ul' ).append( $counterItem ); | ||
} ); | } ); | ||
Revision as of 19:34, 19 June 2026
/* Any JavaScript here will be loaded for all users on every page load. */
$.when( mw.loader.using( 'mediawiki.util' ), $.ready ).then( function () {
var targetDate = new Date(2026, 2, 22);
var today = new Date();
var timeDifference = today.getTime() - targetDate.getTime();
var daysSince = Math.floor(timeDifference / (1000 * 60 * 60 * 24));
var $counterItem = $( '<li>' )
.attr( 'id', 'mw-custom-sidebar-counter' )
.attr( 'class', 'mw-list-item')
.text( daysSince );
$( '#p-Days_Since_Mikush_Disappeared ul' ).append( $counterItem );
} );