Extension talk:Semantic Result Formats/calendar format

Hi! Is it somehow possible to have a calendar entry for more than one day? Right now it seems that one wiki page can have only one date that is displayed in the calendar. If the property date is used several times (each with different dates) on that page, only the last entry is used for the calendar. So can I somehow either give the page several date entries or a "from...to", so that it is displayed for several days in the calendar? I also tried using two properties, start date and end date, and querying for both, but then again the calendar uses only the last date it finds on the page. - FR


 * That sounds like a bug; you should be able to specify more than one day. To use more than one property, though, you have to use this format within Semantic Compound Queries. Yaron Koren 14:00, 24 September 2009 (UTC)


 * Thanks for the fast reply. I have to admit that I am currently still using the old semantic calendar extension. However I could not find any information that the behavior changed (in contrast to the semantic google maps, where the changelog points out that just in the newer versions a page can have more than one set of coordinates). Will try with the current version of semantic results format and the compound queries... - FR 80.152.199.128 15:24, 24 September 2009 (UTC)

At least in my wiki the calendar produces a bug. My wiki has an URL like

https://wiki.mypage.com/index.php

Now when I open the calendar, it might link to an entry like

https://wiki.mypage.com/index.php/Appointment_2010

So far everything is fine. But once I change the month (or just go forward an backwards, having the same month on the screen as before) the calendar suddenly links to

https://wiki.mypage.com/Appointment_2010

This is invalid, as the index.php is missing in the URL. The reason is that relative paths are used, and while the calendar has the URL

https://wiki.mypage.com/index.php/Calendar when I open it, once I change the month it becomes

https://wiki.mypage.com/index.php?title=Calender&month=11&year=2009

So this is where it has problems with the relative paths, because now the index.php is not part of the local URL anymore. Do you agree that this should be fixed? And can you probably provide some quick code that needs to be changed to make it work again? --80.152.199.128 16:24, 29 October 2009 (UTC)Thanks,


 * Is it possible that you have $wgArticlePath set incorrectly in your LocalSettings.php file? It should be "/index.php/$1". Yaron Koren 19:38, 29 October 2009 (UTC)


 * Thanks. So far I did not have an $wgArticlePath in my LocalSettings.php at all, it was never specified automatically. However, also when I put it in, the problem stays the same. I now have this:

$wgScriptPath      = ""; $wgScriptExtension = ".php";

$wgArticlePath = "/index.php/$1"; Any more ideas? --80.152.199.128 20:05, 29 October 2009 (UTC)


 * No idea; that should work. Do regular wiki-links work on a page, when you have the page's URL set to the form "/index.php?title=Page_name"? Yaron Koren 23:06, 29 October 2009 (UTC)


 * Yes, manually changing the URL from "/index.php/Testpage" to "index.php?title=Testpage" leaves the links working. Problem only exists on calendar when I jump to a different calendar page.--78.34.102.66 11:04, 2 November 2009 (UTC)
 * What versions of MediaWiki, SMW and SRF are you using? Yaron Koren 15:32, 2 November 2009 (UTC)
 * MediaWiki 1.15, SMW 1.4.1 and SRF 1.4.5, pretty up to date I think. --78.34.102.66 15:45, 2 November 2009 (UTC)
 * Okay, found out something more: There is no problem with the calendar when selecting different months with the drop-down box on the right side, then the URL keeps the right format "/index.php/Kalender?title=Kalender&month=7&year=2009". Just when going to next or previous month with the two arrows right and left of the "Today" link, the URL switches to "/index.php?title=Kalender&month=11&year=2009". Here is a screenshot of what I mean: http://www.abload.de/img/calendarr9rp.png. Wondering that no one else has experienced this issue before, there seems to be a problem with those two buttons. --87.79.175.64 18:03, 2 November 2009 (UTC)


 * Wait, those arrows point to URLs that contain "index.php"? The problem before was that they didn't include "index.php", right? Yaron Koren 18:49, 2 November 2009 (UTC)
 * With the arrows you reach an URL where the index.php is followed by a question mark, as stated above. And once the calendar URL is like this, all links within the calendar are missing the index.php. If I edit the URL manually, putting the "/" after the index.php and reloading the page, also the links in the calendar have the index.php included again.--87.79.176.218 07:51, 3 November 2009 (UTC)


 * My guess is that this is somehow a problem with your wiki's URL rewriting, but I don't know more than that. Yaron Koren 18:10, 4 November 2009 (UTC)

I find the text a bit unclear, at least it isn't clear to me how I should be able to get this to work. I am able to get a calendar, but don't get any events on there.

Could someone add a step-by-step guide? Questions I have are: - Do I need to add anything more than the property date, within or outside a template? I now did (left out the {}):

update
 * date=February 22, 2010


 * Do I need to define date as date? So edit date to state "has type::date"?
 * Do I need to define a page explicitly as event, or does that happen automatically due to it having a date?
 * Or, should I just define a different kind of category and use that one?
 * Do I need to define #calendarstartdate and #calendarenddate?

Sorry if I have missed something in the semantic mediawiki guide, please give me specific pointers to what, if anything, I clearly missed or misunderstood.

Thanks a lot in advance,

Frank


 * Hi - yes, the date property (whether it's called "Date" or anything else) has to be defined with "has type::date". No, you don't need to do anything else to define a page as an event. And you don't need to define those two functions - you don't even need to use them for now. I would try running the query without "format=calendar" and see if you can get any results - it could be that your problem is unrelated to the calendar. Yaron Koren 18:54, 1 March 2010 (UTC)


 * Fixed it, is was indeed calendar independent: interpreted the 'has date' as something haveing the property 'date', but ofcourse it is just another name for a date property or whatever you call it. So, given my definition of an update, my query had to read 'date' everywhere where 'has date' was used.--82.75.111.229 15:47, 7 March 2010 (UTC)

Is the calendar supposed to honor local time for the user?
I'm using the current version of SRF. When using the calendar format I notice that it is using UTC to determine which day is the current day, instead of using the local offset for the current user. As an example, for me with a local time offset of "-8:00", any time after 1600 hours local the calendar shows tomorrow as the current day instead of today.

I would have thought the calendar could pick up the users time offset and incorporate that into the date calculations?

Thanks!

Al Hooton

Future Development
Are there any plans that will allow the Calendar format to query more than simply the page title? I run a racing website that covers a number of different racing series, so instead of the user simply seeing all the races on a given date, it'd be nice to be able to add a ?Series argument so that the user instead of seeing 2010 Joe Shear Classic 136, 2010 Crane Cams 250 can instead see 2010 Joe Shear Classic 136 (ASA-MWT), 2010 Crane Cames 250 (USAR). --98.101.84.49 18:19, 15 April 2010 (UTC)


 * You can already do that, can't you? Yaron Koren 15:50, 3 May 2010 (UTC)

Display events as bullet points or alternating colours within the calendar
The existing options for colour are fine but would it be possible to display events within one day as bullet points and/or as alternating lines so every event entry displays with alternating background colour since one day can have more than one entry and it gone be hard to read with out an identifier. --MWJames 15:13, 3 May 2010 (UTC)


 * This sounds like a question better suited to the mailing list, since there are a lot of factors that could go into the design. Yaron Koren 15:52, 3 May 2010 (UTC)


 * Thanks, that's fine with me, just sent out the message. --MWJames 15:04, 4 May 2010 (UTC)