Bug 869028

Summary: Dates are not localised in subscription-manager-gui
Product: Red Hat Enterprise Linux 6 Reporter: J.C. Molet <jmolet>
Component: subscription-managerAssignee: candlepin-bugs
Status: CLOSED NOTABUG QA Contact: IDM QE LIST <seceng-idm-qe-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.4CC: alikins
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-13 22:47:20 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 771481    

Description J.C. Molet 2012-10-22 20:05:30 UTC
Description of problem:
It seems that the dates are not localized in the correct format in subscription-manager-gui.

Version-Release number of selected component (if applicable):
python-rhsm-1.1.3-1.git.0.4bda2ce.el6.x86_64
subscription-manager-gui-1.1.3-1.git.29.1721610.el6.x86_64
subscription-manager-1.1.3-1.git.29.1721610.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1.  Fire up subscription-manager-gui on rhel6.4 box
2.  Register your system to a candlepin server
3.  Search for subscritpions or look at dates on existing subscriptions
  
Actual results:
The dates seem to be in this format: 10/21/12  or %m/%d/%y
This appears in the following locations: 
- Start and end dates under My Installed Products
- Start and end dates in the contract selection dialog
- End date under My Subscriptions
- Start and end dates under My Subscription Details

Expected results:
When I use python to grab the expected format for my locale I get:
[root@jmolet-vm1 ~]# python -c "import locale;\ locale.setlocale(locale.LC_TIME,'en_US'); print\
locale.nl_langinfo(locale.D_FMT)"

%m/%d/%Y

Logic would seem to follow that my locale be printed in this format when using the gui.

Additionally the cli portion of subscription-manager uses this format and therefore the gui should be the same.

Comment 1 Adrian Likins 2012-12-13 22:47:20 UTC
This change is from:

commit ea0469db2f2eea176e90f54cf3419a6fd6dc74e9
Author: Adrian Likins <alikins>
Date:   Fri Jul 20 14:00:17 2012 -0400

    Use ISO8601 date format in allsubs tab
    
    Previously we were using the localized date
    format (ala, strftime('%s')) which is lovely,
    but is more or less impossible to parse, even
    by the tools that claim to (for ex, strptime('%x')).
    
    We had worked around this in a few cases, by
    falling back to en_GB localized date format,
    but that was pretty much just a kluge. For
    bonus fun, some of the dates would only
    fail to parse on double digit months. Or for
    some locales, specific months that had
    unicode char's the date parser didn't like.
    In addition, strptime() is especially broken
    on python 2.4 available on RHEL 5 and earlier.
    
    So, enough of that. ISO8601 dates it is.
    
    - remove locale kluge
    - remove unit tests specifically for that kluge
    - add test cases for widgets.DatePicker