Last modified: 2014-06-23 16:07:04 UTC
After an upgrade from 1.18.1 to 1.21.2 noticed some of my templates were broken. In troubleshooting them, discovered weird behaviour of timel:t where it wouldn't return the right number of days in a month if the date argument was the first day of a month with 30 or 28 days in it. #time: showed no such behaviour. Maybe something I'm doing wrong. Couldn't find a bug like it. example output: {{#timel:t|2013-01-01}} ▷ 31 {{#timel:t|2013-02-10}} ▷ 28 {{#timel:t|2013-02-01}} ▷ {{#timel:t|2013-Feb}} ▷ 31
sorry, that 3rd example is: {{#timel:t|2013-02-01}} ▷ 31
Why are you using #timel? It's using your wiki's timezone, and it might turn out that 2013-02-01 (UTC) is 2013-01-31 (your local timeze), which has 31 days. I would bet that is the case.
Analysis in comment 2 sounds about right -- go ahead and use #time instead of #timel here and your problem should be fixed. (Basically, remember that the input timestamp always carries a time as well as a date, and *that* is in UTC/GMT timezone: when you say '2013-02-01' you actually are telling it '2013-02-01 00:00:00 UTC'. #timel shifts that time to your local timezone, which might be say '2013-01-31 19:00:00 UTC-0500' for EST... so you end up calculating the days-in-month for the local month, January.)
Ah. Yes. I see. Supplying a date of 2013-02 really resolves to 2013-02-01 00:00:00. Asking timel to do anything with it implies that the argument supplied is UTC. The behavior changing from 1.18.1. threw me. It's behaving MORE consistent with it's intent. I'll let the next one stew longer before running to mommy.