-
Notifications
You must be signed in to change notification settings - Fork 100
Labels
Description
Maybe we can replace the start date/end date in the infobox with this too?
imo it is better to show the full ISO 8601 date in infobox
I think we could convert TournamentsList to use DateRange thoughOriginally posted by @ElectricalBoy in #6461 (comment)
Lua-Modules/lua/wikis/commons/TournamentsListing/CardList.lua
Lines 456 to 481 in 4ac4148
| ---@param startDate string | |
| ---@param endDate string | |
| ---@param status string? | |
| ---@return string | |
| function BaseTournamentsListing._dateDisplay(startDate, endDate, status) | |
| if status == POSTPONED or status == DELAYED then | |
| return 'Postponed' | |
| end | |
| if startDate == endDate then | |
| return LANG:formatDate('M j, Y', startDate) --[[@as string]] | |
| end | |
| local startYear, startMonth = startDate:match('(%d+)-(%d+)-%d+') | |
| local endYear, endMonth = endDate:match('(%d+)-(%d+)-%d+') | |
| if startYear ~= endYear then | |
| return LANG:formatDate('M j, Y', startDate) .. ' - ' .. LANG:formatDate('M j, Y', endDate) | |
| end | |
| if startMonth == endMonth then | |
| return LANG:formatDate('M j', startDate) .. ' - ' .. LANG:formatDate('j, Y', endDate) | |
| end | |
| return LANG:formatDate('M j', startDate) .. ' - ' .. LANG:formatDate('M j, Y', endDate) | |
| end |
TournamentsList template (or more precisely, Module:TournamentsListing/CardList) displays month, day, and year for range, while the DateRange widget currently displays only month and day.
To be able to use the DateRange widget in the TournamentsList template, we need to add year support to it. (#6824 )