Page MenuHomePhabricator

mw.lang:formatDate parse wrong year with format "o".
Closed, InvalidPublic

Description

Hi! {{#timel:o}} in Norwegian Bokmål Wikipedia produces:

  • 2020

It's 2021 so, this is a little weird.

Same for Lua with mw.lang:formatDate.

local lang = mw.getContentLanguage()
print(lang:formatDate('o', '0 year', true))
2020
local month = tonumber(lang:formatDate('n', '0 month', true))
print(month)
1
print(lang:formatDate('r', '0 year', true))
Fri, 01 Jan 2021 17:37:10 +0100

Event Timeline

jhsoby closed this task as Invalid.EditedJan 1 2021, 4:43 PM

That is the way it should be, o is the year the current week belongs to (and we're still in week 53 of 2020 until Monday).

See the \#time section in https://mediawiki.org/wiki/Help:Extension:ParserFunctions