Last modified: 2014-03-12 10:26:21 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T64564, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 62564 - enhance Semantic Result Formats Math to calculate Dates
enhance Semantic Result Formats Math to calculate Dates
Status: UNCONFIRMED
Product: MediaWiki extensions
Classification: Unclassified
SemanticBundle (Other open bugs)
unspecified
All All
: Unprioritized enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-03-12 10:26 UTC by Thomas Ramm
Modified: 2014-03-12 10:26 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Thomas Ramm 2014-03-12 10:26:21 UTC
I add to the SemanticResultFormats/formats/math/SRF_Math.php the lines and can use this Result Formats to calculate dates, for querys like "get the last president" if the president-pages has a date field "starting Job".

This resolution give the timestamp with decimalseparator, so i have to convert the result.

My Example: 
Question: When was my last Review?
Solution: {{#time: Y-m-d|@{{#replace:{{#ask: [[HasReview::{{{1|}}}]] ?DateOfVisit |format=max}}|.|}}}}

Codechange ond SRF_Math.php:
110+ case SMWDataItem::TYPE_TIME:
111+   $numbers[] = $dataItem->getMwTimestamp();
112+   break;

Maybe there is a better solution than getMwTimestamp(), but i dont know the available functions to return as "normal" date.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links