Extension:DateDiff
From MediaWiki.org
|
DateDiff Release status: beta |
|||
|---|---|---|---|
| Implementation | Parser functions | ||
| Description | Takes two dates and returns all intermediary days. | ||
| Author(s) | Kwisatz, Jeroen De Dauw | ||
| Last version | 0.1.1 (2010-9-13) | ||
| MediaWiki | 1.15 or above, possibly older | ||
| License | CC BY-SA 3 | ||
| Download |
Download snapshot (Git master)
Git [?]: repo summary • tree • code changes SVN [?]: checkout-url • tree • code changes |
||
|
|||
|
Check usage (experimental) |
|||
Adds a 'dates' parser function that returns a list of intermediary days.
Contents |
[edit] Setup
[edit] Download
You can download the code directly via SVN from the MediaWiki source code repository, at http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/DateDiff/. From a command line, you can call the following:
svn checkout http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/DateDiff/
[edit] Installation
Place the DateDiff directory within the main MediaWiki 'extensions' directory. Then, in the file LocalSettings.php in the main MediaWiki directory, add the following line:
include_once("$IP/extensions/DateDiff/DateDiff.php");
[edit] Use cases
A typical use case are events in a Extension:Semantic MediaWiki setup that span multiple days. In order to have the events appear on all days on the Extension:Semantic Result Formats calendar output, you would use something like:
{{#ifeq: {{{recurring}}} | no | {{#arraymap: {{#dates: | StartDate={{{from}}} | EndDate={{{till}}} }}|,|x|[[Has date::x| ]]| }} }}