You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2021/11/25 05:24:15 UTC

[Bug 65703] New: DataFormatter optional mode that modifies date formats with 2 digit years to 4 digit years

https://bz.apache.org/bugzilla/show_bug.cgi?id=65703

            Bug ID: 65703
           Summary: DataFormatter optional mode that modifies date formats
                    with 2 digit years to 4 digit years
           Product: POI
           Version: 5.0.x-dev
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: SS Common
          Assignee: dev@poi.apache.org
          Reporter: fanningpj@yahoo.com
  Target Milestone: ---

This would be optional but would help in scenarios like
https://stackoverflow.com/questions/42259859/java-excel-to-csv-date-conversion-issue-with-apache-poi/42285272#42285272

XSLX is ok with 2 digit year formats because we have the raw date in number
format. If someone uses XLSX2CSV to write data to CSV then the formatted date
in the CSV is all that's kept. 

DataFormatter already has an emulateCSV option - maybe this could be used to
control the optional behaviour to modify the date format to have 4 digits in
the year. Alternatively, we can add a new parameter.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 65703] DataFormatter optional mode that modifies date formats with 2 digit years to 4 digit years

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65703

--- Comment #1 from PJ Fanning <fa...@yahoo.com> ---
One existing API that may be useful is
https://poi.apache.org/apidocs/dev/org/apache/poi/ss/usermodel/DataFormatter.html#addFormat-java.lang.String-java.text.Format-

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 65703] DataFormatter optional mode that modifies date formats with 2 digit years to 4 digit years

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65703

PJ Fanning <fa...@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 65703] DataFormatter optional mode that modifies date formats with 2 digit years to 4 digit years

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65703

--- Comment #2 from PJ Fanning <fa...@yahoo.com> ---
Added r1895326 - DataFormatter now has a
setUse4DigitYearsInAllDateFormats(boolean) method with default of false

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org