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 2025/05/12 13:05:54 UTC

[Bug 69681] New: Issue with date format ending with ".000 AM/PM" (a date format ending with milliseconds + AM/PM with a space in between).

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

            Bug ID: 69681
           Summary: Issue with date format ending with ".000 AM/PM" (a
                    date format ending with milliseconds + AM/PM with a
                    space in between).
           Product: POI
           Version: 5.4.1-FINAL
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSSF
          Assignee: dev@poi.apache.org
          Reporter: cedric.allain@nasdaq.com
  Target Milestone: ---

Created attachment 40039
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=40039&action=edit
Test code to reproduce the issue

We found an issue in POI, when we use a date format ending with ".000 AM/PM" (a
date format ending with milliseconds + AM/PM with a space in between).
In this case POI do not recognize the cell style as a date style in the process
of auto sizing columns.
Because of this the column is too small for the displaying value after auto
resizing.

I attach a sample code showing the issue, the output of this sample code is.
Cell with format "DD MMMM, YYYY hh:mm:ss.000 AM/PM" is date formatted : false
Column width after autoresize: 1411
Formatted Cell Value: 45771
Cell with format "DD MMMM, YYYY hh:mm:ss.000AM/PM" is date formatted : true
Column width after autoresize: 6165
Formatted Cell Value: 24 April, 2025 12:00:00.000AM


We see the date format with space between milliseconds and AM/PM is not
recognized as a Date but a numeric,
the auto sizing set the column width based on the numeric value.

Without the space then the style is recognized as a Date style and the width is
correct after auto sizing.

We also see the DataFormatter do not recognize the format as date 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 69681] Issue with date format ending with ".000 AM/PM" (a date format ending with milliseconds + AM/PM with a space in between).

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

--- Comment #2 from PJ Fanning <fa...@yahoo.com> ---
current fix only allows one optional space before the AM/PM part

-- 
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 69681] Issue with date format ending with ".000 AM/PM" (a date format ending with milliseconds + AM/PM with a space in between).

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

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

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

--- Comment #1 from PJ Fanning <fa...@yahoo.com> ---
added
https://github.com/apache/poi/commit/c784266438a28d8e1868242bc261961b894fe3c8

-- 
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 69681] Issue with date format ending with ".000 AM/PM" (a date format ending with milliseconds + AM/PM with a space in between).

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

Matafagafo <ma...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |matafagafo@gmail.com
                 OS|                            |All

-- 
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