package com.prolog.rdc.tms.util;

import java.util.Date;

import com.prolog.common.util.ToolKits;

import cn.hutool.core.date.DateUtil;

/**
 * 
 *
 * 日期工具类
 *
 * @className :DateUtils
 * @author :fanzw
 * @creationTime :2022/09/15
 * @description :
 *
 * @modifier :fanzw
 * @modifyTime :2022/09/15
 * @reviseRemarks:
 *
 * @version :1.0.0
 *
 */
public class DateRdcUtils {

	/**
	 * 开始结束时间拼接
	 * 
	 * @param startDt
	 * @param endDt
	 * @return
	 */
	public static String timeSplicing(Date startDt, Date endDt) {
		if (ToolKits.isEmpty(startDt) && ToolKits.isEmpty(endDt)) {
			return "";
		} else if (ToolKits.isEmpty(endDt)) {
			return DateUtil.format(startDt, "yyyy-MM-dd hh:mm:ss") + " ~ ";
		} else if (ToolKits.isEmpty(startDt)) {
			return " ~ " + DateUtil.format(endDt, "yyyy-MM-dd hh:mm:ss");
		}
		return DateUtil.format(startDt, "yyyy-MM-dd hh:mm:ss") + " ~ " + DateUtil.format(endDt, "yyyy-MM-dd hh:mm:ss");
	}
}
