-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[python] Fixed getRegion dateshort format without leading zero #8282
Conversation
According to https://msdn.microsoft.com/en-us/library/fe06s4ak.aspx windows supports removing leading zeros with |
I could test linux if required (no windows machine available for next 2 weeks). So if you want me to test, just ping me again. |
090662a
to
d1ebec6
Compare
Nice find @tamland, it does indeed work on Windows. I've updated the PR. |
@tamland ok to merge? |
@MartijnKaijser Is there a specific reason why this hasn't been merged? |
Sorry for not replying, it completely slipped my mind. I asked koying about it a while back and it most likely will not work on android. We only know it works on linux and windows. Either it must be tested on all other platforms, or documentation found that it will, or the leading zero format must be left on those platforms. It's far worse to use and invalid format here and break addons using it than a leading zero. This is a fix and when done it can still be merged for jarvis. |
@tamland OK I can also test this on Android and Mac OS X to make sure it's valid on those platforms. The only platform I can't test is iOS. P.S. To be clear the problem is not that it shows a leading zero when it shouldn't, it actually currently outputs a completely incorrect strftime, albeit one which is technically valid and won't throw an exception. When locale.shortdateformat is EDIT: The - format does work on Android. |
Not quite my area. If you want me to test something because you have no access to a droid device, you'll have to tell me what to test an how ;) |
Same question - how can i test this? |
Something like this should do it. from datetime import date
import xbmc, xbmcgui
fmt = xbmc.getRegion('dateshort')
xbmcgui.Dialog().notification(fmt, date.today().strftime(fmt)) Change the I can upload a test add-on this evening if it helps. |
that would help indeed ;) |
@LS80 - works on ios - thx for spoon feeding me :) |
jenkins build this please |
[python] Fixed getRegion dateshort format without leading zero
Currently xbmc.getRegion('dateshort') returns a bad strftime format when locale.shortdateformat has the month and or date without a leading zero e.g. YYYY-M-D would become %Y-M-D.
Linux and OS X strftime has %-m and %-d.
Windows has to fallback to YYYY-MM-DD i.e. with leading zeros.EDIT: The Windows equivalent is %#m and %#d.
EDIT: Platforms tested: