@iot9x.com/ipc-utils
Version:
九星云、九星小程序、九星配置工具所共用的库方法
16 lines (15 loc) • 644 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const dayjs = require("dayjs");
const duration = require("dayjs/plugin/duration");
dayjs.extend(duration);
class FormatUtil {
}
/** 大驼峰转小驼峰 */
FormatUtil.upperCamelCaseToLoweCamelCase = (data) => data.replace(/([A-Z])/, (a, b) => b.toLowerCase());
/** 时间格式化年月日时分秒 */
FormatUtil.formatDate = (date) => dayjs(date).format('YYYY-MM-DD HH:mm:ss');
FormatUtil.formatDuration = (date) => dayjs.duration(date);
/** 时间格式化时分秒 */
FormatUtil.formatHms = (date) => dayjs(date).format('HH:mm:ss');
exports.default = FormatUtil;