https://bugzilla.wikimedia.org/show_bug.cgi?id=62564

            Bug ID: 62564
           Summary: enhance Semantic Result Formats Math to calculate
                    Dates
           Product: MediaWiki extensions
           Version: unspecified
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: Unprioritized
         Component: SemanticBundle
          Assignee: wikibugs-l@lists.wikimedia.org
          Reporter: thomas.r...@manserv.de
                CC: jeroen_ded...@yahoo.com
       Web browser: ---
   Mobile Platform: ---

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to