Extension:DateDiff

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual
Crystal Clear action run.png
DateDiff

Release status: beta

Implementation Parser function
Description Takes two dates and returns all intermediary days.
Author(s) Kwisatz,
Jeroen De Dauw
Latest version 0.1.1 (2010-09-13)
MediaWiki 1.15+
Database changes No
License Creative Commons Attribution Share Alike 3.0
Download Template:WikimediaDownload/svn
Hooks used
ParserFirstCallInit

Translate the DateDiff extension if it is available at translatewiki.net

Check usage and version matrix; code metrics

The DateDiff extension adds a 'dates' parser function that returns a list of intermediary days.

Usage[edit | edit source]

A typical use case are events in a semantic setup that span multiple days. In order to have the events appear on all days on a calendar provided by the Semantic Result Formats extension, you would use something like:

{{#ifeq: {{{recurring}}} | no | {{#arraymap: {{#dates: | StartDate={{{from}}} | EndDate={{{till}}} }}|,|@@@@|[[Has date::@@@@| ]]| }} }}

Installation[edit | edit source]

vagrant>Vagrant</>, install with <tvar

  • <translate>

1>download-link</> and place the file(s) in a directory called <tvar|name>DateDiff</> in your <tvar|ext>extensions/</> folder.</translate>

  • <translate>

Add the following code at the bottom of your LocalSettings.php:</translate>

require_once "$IP/extensions/DateDiff/DateDiff.php";
  • YesY Done <translate>

Navigate to "Special:Version" on your wiki to verify that the extension is successfully installed.</translate>