2014-03-24, 16:43
(2014-03-24, 02:49)WayneD Wrote:From my point of view format of returned value should be consistent with XBMC formatting, otherwise using xbmc.getRegion() is half useless.(2014-03-24, 02:08)bambi73 Wrote:Yeah, the code was doing that before I got to it. I figure that the prior author(s) liked the brevity in the 2-digit years and decided to force it. I personally use the Next-Aired setting that turns on the nicer dates, which either omits the current year entirely, or uses a 4-digit year for other years.Why is there lower()?Code:DATE_FORMAT = xbmc.getRegion('dateshort').lower()
I'm hesitant to change the default format to be different than what it is without some discussion somewhere about it first. I personally would be fine changing it to a 4-digit year, but then I don't ever see it.
..wayne..
For example in my skin i show ListItem.Premiered and NextAired one above the other and it looks weird.
My guess about why original author used lower() is that it has more to do with following lines. Currently xbmc.getRegion() return regular formatting string (%d-%m-%Y in my case) but this code operate with index 0 where is always '%'. I'm not sure but it looks like XBMC in pre-Gotham/Frodo era returned something different (not Python compatible) and so there is this conversion code. And maybe lower wasn't problem in this case.
Anyway I have no problem if you want to discuss it with someone else, i can correct it localy.