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 CC BY-SA 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]

  • Copy the code into files and extract the tarball in your extensions/ folder. It should generate a new folder called DateDiff directly inside your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
require_once "$IP/extensions/DateDiff/DateDiff.php";
  • Done! Navigate to "Special:Version" on your wiki to verify that the extension is successfully installed.