mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
修改 pr by close的问题
This commit is contained in:
@@ -542,10 +542,7 @@ public class DateUtil extends CalendarUtil {
|
||||
if (null == format || null == date) {
|
||||
return null;
|
||||
}
|
||||
// java.time.temporal.UnsupportedTemporalTypeException: Unsupported field: YearOfEra
|
||||
if (format.getZone() == null) {
|
||||
format = format.withZone(ZoneId.systemDefault());
|
||||
}
|
||||
/// java.time.temporal.UnsupportedTemporalTypeException: Unsupported field: YearOfEra
|
||||
/// return format.format(date.toInstant());
|
||||
return TemporalAccessorUtil.format(date.toInstant(), format);
|
||||
}
|
||||
|
@@ -8,7 +8,7 @@ public class NumberChineseFormatterTest {
|
||||
@Test
|
||||
public void formatTest() {
|
||||
String f0 = NumberChineseFormatter.format(50008000, false);
|
||||
Assert.assertEquals("五千万零8千", f0);
|
||||
Assert.assertEquals("五千万零八千", f0);
|
||||
String f1 = NumberChineseFormatter.format(10889.72356, false);
|
||||
Assert.assertEquals("一万零八百八十九点七二", f1);
|
||||
f1 = NumberChineseFormatter.format(12653, false);
|
||||
|
@@ -13,7 +13,15 @@ import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
import java.util.TimeZone;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.Calendar;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.GregorianCalendar;
|
||||
|
||||
/**
|
||||
* 时间工具单元测试<br>
|
||||
|
Reference in New Issue
Block a user