Difference between revisions of "Template talk:CalendarSingle"

From FollowTheScore
Jump to: navigation, search
(Date bug)
Line 20: Line 20:
  
 
--[[User:El sjaako|El sjaako]] 03:25, 18 December 2007 (CET)
 
--[[User:El sjaako|El sjaako]] 03:25, 18 December 2007 (CET)
 +
 +
=== Reply ===
 +
 +
For some strange reason the #time function seems to deliver different values under different versions of MW / PHP. Indeed it may be necessdary to use day 1/8/15/22 here or 2/9/16/23. So if months start at the wrong day just change the number here. Maybe sometime there will be a better solution ... [[User:Gero|Gero]] 08:38, 22 December 2007 (CET)

Revision as of 09:38, 22 December 2007

hey

I've made a preload version of the calendar which directs to Template:Monthly_calendar [1], and if the month calendar doesnt exist yet, creates it. Now to find a few to pass the month-number... Maybe is possible by extracting it from the {{PAGENAME}}.

{{Calendar/MonthStart{{#time:D|{{{year}}}-{{{month}}}-01 +1 second}}
|cur_month={{#time:F|{{{year}}}-{{{month}}}-03}}
|prev_month={{#ifexist: {{{basepage}}} {{#time:F Y|{{{year}}}-{{{month}}}-03 -1 month}}|[[{{{basepage}}} {{#time:F Y|{{{year}}}-{{{month}}}-03 -1 month}}|<<]]|[{{fullurl:{{{basepage}}} {{#time:F Y|{{{year}}}-{{{month}}}-03 -1 month}}|action=edit&preload=Template:Monthly_calendar}} <<]}}
|next_month={{#ifexist: {{{basepage}}} {{#time:F Y|{{{year}}}-{{{month}}}-03 +1 month}}|[[{{{basepage}}} {{#time:F Y|{{{year}}}-{{{month}}}-03 +1 month}}|>>]]|
[{{fullurl:{{{basepage}}} {{#time:F Y|{{{year}}}-{{{month}}}-03 +1 month}}|action=edit&preload=Template:Monthly_calendar}} >>]}}

-- Eiland 01:19, 26 August 2007 (CEST)

Date bug

If you look at the calendar, you will see that this month (December 2007) starts on a Friday. This is not correct, it should start on a saturday. You can correct this by changing

{{Calendar/MonthStart{{#time:D|{{{year}}}-{{{month}}}-01 +1 second}}

to

{{Calendar/MonthStart{{#time:D|{{{year}}}-{{{month}}}-02 +1 second}}

. But I really don't think this is the best way to do it. I have it changed this way on my wiki, but I'd really like to see a proper solution.

--El sjaako 03:25, 18 December 2007 (CET)

Reply

For some strange reason the #time function seems to deliver different values under different versions of MW / PHP. Indeed it may be necessdary to use day 1/8/15/22 here or 2/9/16/23. So if months start at the wrong day just change the number here. Maybe sometime there will be a better solution ... Gero 08:38, 22 December 2007 (CET)