Due to the impact related to this issue, we have to defer this issue to the next major or minor release.
  1. #1
    Ext GWT Premium Member
    Join Date
    Aug 2011
    Posts
    7
    Vote Rating
    1
    oren.s is on a distinguished road

      0  

    Default Timefield with Japanese locale does not accept its own values

    Timefield with Japanese locale does not accept its own values


    REQUIRED INFORMATION

    Ext version tested:
    • Ext 4.1.0 rev release
    Browser versions tested against:
    • Chrome 18/19
    • FF 10
    DOCTYPE tested against:
    • html
    Description:
    Timefield with some non-English locales, such as Japanese, does not accept its own values: the field formats times according to the locale but fails to parse the resulting strings, and as a result mark the string as invalid input.

    As far as I can see, the root cause has to do with Ext.Date's parse method, see test case below.
    Also see this Q&A thread, where I discussed the issue with scottmartin in more detail, but I think this description and the test case provide the relevant information. I found this issue a month ago and was told it will be fixed in the stable release. Since that did not happen, I will very much appreciate if you could give the issue higher priority.

    Steps to reproduce the problem:
    1. Use Japanese locale to view a simple timefield; OR...
    2. Run the test case code in a JS console with Japanese locale.
    The result that was expected:
    1. [viewing a timefield] Inputs are valid.
    2. [running test case] The last line returns a JS Date object.
    The result that occurs instead:
    1. [viewing a timefield] Inputs are invalid.
    2. [running test case] The last line returns undefined.
    Test Case:
    Code:
    var format = Ext.form.field.Time.prototype.format;
    var = Ext.Date.format( new Date(), format );
    Ext.Date.parse( formattedDateString, format );

    Operating System:
    • Win7

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,212
    Vote Rating
    858
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    The locale files are in dire need of repair and we are working to correct them.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Jan 2012
    Posts
    1
    Vote Rating
    0
    mritzman is on a distinguished road

      0  

    Default


    I took a look at the ext-lang-zh_CN.js file since the timefield validation was working correctly in Chinese. I found that adding this snippet to the ext-lang-ja.js file fixed the timefield validation problem for me. This snippet is similar to what was in the ext-lang-zh_CN.js file.

    Code:
    parseCodes = {
                g: 1,
                c: "if (/(午前)/i.test(results[{0}])) {\n"
                    + "if (!h || h == 12) { h = 0; }\n"
                    + "} else { if (!h || h < 12) { h = (h || 0) + 12; }}",
                s: "(午前|午後)",
                calcAtEnd: true
    };
    
    Ext.Date.parseCodes.a = Ext.Date.parseCodes.A = parseCodes;
    This snippet should be just below this code:

    Code:
    Ext.Date.formatCodes.a = "(this.getHours() < 12 ? '午前' : '午後')";
    Ext.Date.formatCodes.A = "(this.getHours() < 12 ? '午前' : '午後')"; // no case difference
    If this is all that needs to be changed I don't believe this fix should of been deferred to the next major or minor release.

    Note that this change was done in ExtJS 4.1.1

Thread Participants: 2

Tags for this Thread