|
|
|
@ -39,6 +39,7 @@ import cokr.xit.base.file.xls.XLSWriter;
|
|
|
|
|
import cokr.xit.base.file.xls.XLSWriter.CommentSupport;
|
|
|
|
|
import cokr.xit.fims.sndb.service.bean.SndngBean;
|
|
|
|
|
import cokr.xit.foundation.data.DataObject;
|
|
|
|
|
import cokr.xit.foundation.util.DateFormats;
|
|
|
|
|
|
|
|
|
|
public class CmmnUtil {
|
|
|
|
|
|
|
|
|
@ -336,6 +337,34 @@ public class CmmnUtil {
|
|
|
|
|
+ " " + dateStr.substring(8, 10) + ":" + dateStr.substring(10, 12) + ":" + dateStr.substring(12, 14);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static String dateNFormat(String dateStr, String pattern) {
|
|
|
|
|
if(dateStr.length() == 8) {
|
|
|
|
|
return CmmnUtil.date8Format(dateStr, pattern);
|
|
|
|
|
} else if(dateStr.length() == 12) {
|
|
|
|
|
return CmmnUtil.date12Format(dateStr, pattern);
|
|
|
|
|
} else if(dateStr.length() == 14) {
|
|
|
|
|
return CmmnUtil.date14Format(dateStr, pattern);
|
|
|
|
|
} else {
|
|
|
|
|
return dateStr;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static String date8Format(String dateStr, String pattern) {
|
|
|
|
|
DateFormats dataFormats = new DateFormats();
|
|
|
|
|
Date date = dataFormats.parse("yyyyMMdd", dateStr);
|
|
|
|
|
return dataFormats.format(pattern, date);
|
|
|
|
|
}
|
|
|
|
|
public static String date12Format(String dateStr, String pattern) {
|
|
|
|
|
DateFormats dataFormats = new DateFormats();
|
|
|
|
|
Date date = dataFormats.parse("yyyyMMddHHmm", dateStr);
|
|
|
|
|
return dataFormats.format(pattern, date);
|
|
|
|
|
}
|
|
|
|
|
public static String date14Format(String dateStr, String pattern) {
|
|
|
|
|
DateFormats dataFormats = new DateFormats();
|
|
|
|
|
Date date = dataFormats.parse("yyyyMMddHHmmss", dateStr);
|
|
|
|
|
return dataFormats.format(pattern, date);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 숫자형 문자열에 세자리 마다 콤마를 찍어 반환한다.
|
|
|
|
|
* @param str 숫자형 문자열
|
|
|
|
|
* @return 콤마가 표시된 숫자형 문자열
|
|
|
|
|