https://issues.apache.org/bugzilla/show_bug.cgi?id=47071

           Summary: Date format Localization
           Product: POI
           Version: 3.5-dev
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSSF
        AssignedTo: [email protected]
        ReportedBy: [email protected]


This is with 3.5 beta 5.

in org.apache.poi.ss.usermodel.DateUtil.isADateFormat()

The following regular expression is used for the judgment whether
CellStyle.getDataFormatString() is a Date format or not. 
 fs.matches("^[yYmMdDhHsS\\-/,. :]+[ampAMP/]*$") // line 239

However, For instance, the following marks are generally prepared as a built-in
format in the Japanese version Excel, which are NOT recognized as Date format.  
 yyyy"年"m"月";@
 m"月"d"日";@

I think that you should check it by the regular expression after removing the
part enclosed with "" so that localized format can be recognized as Date
format.

like this
-------------
    // And '"any"' into ''
    while( fs.contains("\"")){
        int beginIdx = fs.indexOf("\"");
        if( beginIdx == -1){
            break;
        }
        int endIdx = fs.indexOf( "\"", beginIdx + 1);
        if( endIdx == -1){
            break;
        }
        fs = fs.replaceFirst( fs.substring( beginIdx, endIdx + 1),"");
    }

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to