Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions ujmp-core/src/main/java/org/ujmp/core/util/UJMPFormat.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import java.text.Format;
import java.text.NumberFormat;
import java.text.ParsePosition;
import java.text.SimpleDateFormat;
import java.util.Date;

import org.ujmp.core.Coordinates;
Expand Down Expand Up @@ -62,7 +61,7 @@ public UJMPFormat(boolean multiLine, int width, boolean usePadding) {
symbols.setInfinity("Inf");
defaultNumberFormat = new DecimalFormat("0.0000", symbols);
exponentialNumberFormat = new DecimalFormat("0.000E000", symbols);
dateFormat = new SimpleDateFormat("yyyy-mm-dd");
dateFormat = DateUtil.DATEFORMAT;
this.multiLine = multiLine;
this.width = width;
this.usePadding = usePadding;
Expand Down
2 changes: 1 addition & 1 deletion ujmp-core/src/test/java/org/ujmp/core/util/AllTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
import org.junit.runners.Suite;

@RunWith(Suite.class)
@Suite.SuiteClasses({ TestStringUtil.class, TestXMLUtil.class, ByteBufferConcatenationTest.class })
@Suite.SuiteClasses({ TestStringUtil.class, TestUJMPFormat.class, TestXMLUtil.class, ByteBufferConcatenationTest.class })
public class AllTests {
}
21 changes: 21 additions & 0 deletions ujmp-core/src/test/java/org/ujmp/core/util/TestUJMPFormat.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package org.ujmp.core.util;

import static org.junit.Assert.assertEquals;

import java.util.Calendar;

import org.junit.Test;

public class TestUJMPFormat {

@Test
public void testDatFormat() throws Exception {
final UJMPFormat format = new UJMPFormat(true, 15, true);
final Calendar cal = Calendar.getInstance();
cal.set(2018, Calendar.DECEMBER, 31, 15, 59, 55);
final String text = format.format(cal.getTime());

assertEquals("2018-12-31 ", text);
}

}