[Bug 65619] with POI upgrade to 5.0.0, we see that it formats dates with extra slash

2021-11-21 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65619

Dominik Stadler  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |WORKSFORME

--- Comment #12 from Dominik Stadler  ---
It seems even with your test-case, it is not possible to reproduce this for us.
There are various reasons that can be related, e.g. using different locales,
using some unusual version of Java or other differences in your environment
compared to more usual setups. 

Maybe you can try some more to narrow down why the test-case works fine for us,
but seems to cause problems for you. 

If you find something that should be improved/fixed in Apache POI, please
re-open this issue with more comments.

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



[Bug 65619] with POI upgrade to 5.0.0, we see that it formats dates with extra slash

2021-10-09 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65619

Dominik Stadler  changed:

   What|Removed |Added

   Severity|normal  |regression

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



[Bug 65619] with POI upgrade to 5.0.0, we see that it formats dates with extra slash

2021-10-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65619

--- Comment #11 from PJ Fanning  ---
I added this passing regression test - r1894016

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



[Bug 65619] with POI upgrade to 5.0.0, we see that it formats dates with extra slash

2021-10-07 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65619

--- Comment #10 from PJ Fanning  ---
I ran the sample code and my output was fine (no slashes) - I have this in the
styles.xml - 

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



[Bug 65619] with POI upgrade to 5.0.0, we see that it formats dates with extra slash

2021-10-07 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65619

--- Comment #9 from hethal  ---
Below here is the code that we tried on POI 5.0.0 and POI 4.1.2 as well and
were able to reproduce that the POI 5.0.0 added the extra slashes as attache d
in the jpg image.

Code:
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Date;

import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.CreationHelper;
import org.apache.poi.ss.usermodel.Font;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.streaming.SXSSFSheet;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import org.junit.Test;

public class TestPoi {

@Test
public void test () throws IOException {
SXSSFWorkbook workbook = new SXSSFWorkbook();
SXSSFSheet sheet = workbook.createSheet("Test Sheet 1");
Font font = workbook.createFont();
CellStyle cs = workbook.createCellStyle();
cs.setFont(font);
Row row = sheet.createRow(0);
Cell cell = row.createCell(1);
cell.setCellValue(new Date());
cell.setCellStyle(cs);
CreationHelper ch = workbook.getCreationHelper();
cs.setDataFormat(ch.createDataFormat().getFormat("dd MMM 
HH:mm:ss"));
cs.setAlignment(HorizontalAlignment.RIGHT);
FileOutputStream fos = new FileOutputStream("c:/temp/test.xlsx");
workbook.write(fos);
fos.close();
workbook.close();
workbook.dispose();
}
}

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



[Bug 65619] with POI upgrade to 5.0.0, we see that it formats dates with extra slash

2021-10-07 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65619

--- Comment #8 from hethal  ---
Created attachment 38059
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=38059&action=edit
spreadsheet compare file with date format mismatch between 4.1.2 and 5.0.0.

Showing that there are back slashes in POI 5.0.0 that are not present in POI
4.1.2

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



[Bug 65619] with POI upgrade to 5.0.0, we see that it formats dates with extra slash

2021-10-07 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65619

--- Comment #7 from PJ Fanning  ---
the code in last comment is not POI code - you probably need someone in your
company to use a Java debugger to debug the code

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



[Bug 65619] with POI upgrade to 5.0.0, we see that it formats dates with extra slash

2021-10-07 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65619

--- Comment #6 from PJ Fanning  ---
This is not a reproducible use case - maybe someone else will have a look but I
don't have time to look at this without a reproducible use case.

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



[Bug 65619] with POI upgrade to 5.0.0, we see that it formats dates with extra slash

2021-10-07 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65619

hethal  changed:

   What|Removed |Added

 Status|NEEDINFO|NEW

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



[Bug 65619] with POI upgrade to 5.0.0, we see that it formats dates with extra slash

2021-10-07 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65619

--- Comment #5 from hethal  ---
Please take a look at the below code that we are using for our app:


public Builder dataFormat (String format) 
{
  return new Builder(fontTransform, cellStyleTransform.andThen(
(cs, ch) -> cs.setDataFormat(ch.createDataFormat().getFormat("dd mmm 
";
}

and looks like this code is using the `setDataFormat`, `createDataFormat` and
`getFormat` methods that are of the POI 5.0.0 jar.

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



[Bug 65619] with POI upgrade to 5.0.0, we see that it formats dates with extra slash

2021-10-07 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65619

PJ Fanning  changed:

   What|Removed |Added

 Status|NEW |NEEDINFO

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



[Bug 65619] with POI upgrade to 5.0.0, we see that it formats dates with extra slash

2021-10-07 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65619

--- Comment #4 from PJ Fanning  ---
I can't reproduce any issue - I put a test case at
https://github.com/pjfanning/poi-gradle-example/tree/bug-65619 (NB a branch of
this project called bug-65619).

The code in this branch gives the same result if the build.gradle has poi 5.0.0
or poi 4.1.2.

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



[Bug 65619] with POI upgrade to 5.0.0, we see that it formats dates with extra slash

2021-10-06 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65619

--- Comment #3 from hethal  ---
you can take a look at the below code:
dateFormat = new SimpleDateFormat("dd MMM  HH:mm:ss");

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



[Bug 65619] with POI upgrade to 5.0.0, we see that it formats dates with extra slash

2021-10-06 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65619

--- Comment #2 from hethal  ---
here is the code that we are using in our app


return new DataFormatter() {
@Override
public String formatRawCellContents (double value, int
formatIndex, String formatString) {
if ("GENERAL".equalsIgnoreCase(formatString)) {
return decimalFormat.format(value);
} else if (DateUtil.isADateFormat(formatIndex,
formatString) && DateUtil.isValidExcelDate(value)) {
DateFormat dateFormat;
if (StringUtils.containsIgnoreCase(formatString, "h"))
{
dateFormat = new SimpleDateFormat("dd MMM 
HH:mm:ss");
} else {
dateFormat =  new SimpleDateFormat("dd MMM ");
}
Date date = DateUtil.getJavaDate(value, false);
return dateFormat.format(date);
} else {
return super.formatRawCellContents(value, formatIndex,
formatString);
}
}
};

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



[Bug 65619] with POI upgrade to 5.0.0, we see that it formats dates with extra slash

2021-10-06 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=65619

PJ Fanning  changed:

   What|Removed |Added

 OS||All

--- Comment #1 from PJ Fanning  ---
If this has changed, it is not likely to be intentional. Could you provide a
more complex code sample for review?

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