mirror of
https://gitee.com/dromara/hutool.git
synced 2025-05-12 00:28:03 +08:00
修改 pr by close的问题
This commit is contained in:
parent
75d5268249
commit
65103f3916
@ -542,10 +542,7 @@ public class DateUtil extends CalendarUtil {
|
|||||||
if (null == format || null == date) {
|
if (null == format || null == date) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
// java.time.temporal.UnsupportedTemporalTypeException: Unsupported field: YearOfEra
|
/// java.time.temporal.UnsupportedTemporalTypeException: Unsupported field: YearOfEra
|
||||||
if (format.getZone() == null) {
|
|
||||||
format = format.withZone(ZoneId.systemDefault());
|
|
||||||
}
|
|
||||||
/// return format.format(date.toInstant());
|
/// return format.format(date.toInstant());
|
||||||
return TemporalAccessorUtil.format(date.toInstant(), format);
|
return TemporalAccessorUtil.format(date.toInstant(), format);
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ public class NumberChineseFormatterTest {
|
|||||||
@Test
|
@Test
|
||||||
public void formatTest() {
|
public void formatTest() {
|
||||||
String f0 = NumberChineseFormatter.format(50008000, false);
|
String f0 = NumberChineseFormatter.format(50008000, false);
|
||||||
Assert.assertEquals("五千万零8千", f0);
|
Assert.assertEquals("五千万零八千", f0);
|
||||||
String f1 = NumberChineseFormatter.format(10889.72356, false);
|
String f1 = NumberChineseFormatter.format(10889.72356, false);
|
||||||
Assert.assertEquals("一万零八百八十九点七二", f1);
|
Assert.assertEquals("一万零八百八十九点七二", f1);
|
||||||
f1 = NumberChineseFormatter.format(12653, false);
|
f1 = NumberChineseFormatter.format(12653, false);
|
||||||
|
@ -13,7 +13,15 @@ import java.time.LocalDate;
|
|||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.LocalTime;
|
import java.time.LocalTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
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>
|
* 时间工具单元测试<br>
|
||||||
|
@ -26,6 +26,10 @@ import java.util.List;
|
|||||||
* FTP客户端封装<br>
|
* FTP客户端封装<br>
|
||||||
* 此客户端基于Apache-Commons-Net
|
* 此客户端基于Apache-Commons-Net
|
||||||
*
|
*
|
||||||
|
* 常见搭建ftp的工具有
|
||||||
|
* 1、filezila server ;根目录一般都是空
|
||||||
|
* 2、linux vsftpd ; 使用的 系统用户的目录,这里往往都是不是根目录,如:/home/ftpuser/ftp
|
||||||
|
*
|
||||||
* @author looly
|
* @author looly
|
||||||
* @since 4.1.8
|
* @since 4.1.8
|
||||||
*/
|
*/
|
||||||
|
@ -28,7 +28,8 @@ import java.util.HashMap;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 基于Zxing的二维码工具类
|
* 基于Zxing的二维码工具类
|
||||||
*
|
* 参见二维码网站:
|
||||||
|
* <p>https://cli.im/text</p>
|
||||||
* @author looly
|
* @author looly
|
||||||
* @since 4.0.2
|
* @since 4.0.2
|
||||||
*/
|
*/
|
||||||
|
@ -35,16 +35,22 @@ public class QrCodeUtilTest {
|
|||||||
// 背景色透明
|
// 背景色透明
|
||||||
config.setBackColor(null);
|
config.setBackColor(null);
|
||||||
config.setErrorCorrection(ErrorCorrectionLevel.H);
|
config.setErrorCorrection(ErrorCorrectionLevel.H);
|
||||||
QrCodeUtil.generate("https://hutool.cn/", config, FileUtil.file("d:/qrcodeCustom.png"));
|
String path = FileUtil.isWindows() ? "d:/hutool/qrcodeCustom.png" : "~/Desktop/hutool/qrcodeCustom.png";
|
||||||
|
if (!FileUtil.file(path).getParentFile().exists()) {
|
||||||
|
FileUtil.file(path).getParentFile().mkdirs();
|
||||||
|
}
|
||||||
|
QrCodeUtil.generate("https://hutool.cn/", config, FileUtil.file(path));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore
|
@Ignore
|
||||||
public void generateWithLogoTest() {
|
public void generateWithLogoTest() {
|
||||||
|
String icon = FileUtil.isWindows() ? "d:/hutool/pic/face.jpg" : "~/Desktop/hutool/pic/face.jpg";
|
||||||
|
String targetPath = FileUtil.isWindows() ? "d:/hutool/qrcodeWithLogo.jpg" : "~/Desktop/hutool/qrcodeWithLogo.jpg";
|
||||||
QrCodeUtil.generate(//
|
QrCodeUtil.generate(//
|
||||||
"http://hutool.cn/", //
|
"http://hutool.cn/", //
|
||||||
QrConfig.create().setImg("e:/pic/face.jpg"), //
|
QrConfig.create().setImg(icon), //
|
||||||
FileUtil.file("e:/qrcodeWithLogo.jpg"));
|
FileUtil.file(targetPath));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Loading…
Reference in New Issue
Block a user