Extension:DateDiff
From MediaWiki.org
|
DateDiff Release status: beta |
|||
|---|---|---|---|
| Implementation | Parser function | ||
| 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 | ||
| Database changes | no | ||
| License | CC BY-SA 3 | ||
| Download |
SVN [?]:
|
||
|
|||
| Check usage and version matrix | |||
The DateDiff extension adds a 'dates' parser function that returns a list of intermediary days.
Contents |
Setup [edit]
Download [edit]
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/
Installation [edit]
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");
Use cases [edit]
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| ]]| }} }}