"use strict";

Object.defineProperty(exports, "__esModule", {
  value: !0
}), exports.formatSeconds = exports.dateToNoYS = exports.currentDateMdhms = exports.currentDateHm = exports.currentLongDate = exports.currentDate = exports.dateToHour = exports.dateToHourMi = exports.dateToMouthDay = exports.dateToStr = exports.strToTime = void 0, 
Date.prototype.format = function(t) {
  var e = {
    "M+": this.getMonth() + 1,
    "d+": this.getDate(),
    "h+": this.getHours(),
    "m+": this.getMinutes(),
    "s+": this.getSeconds(),
    "q+": Math.floor((this.getMonth() + 3) / 3),
    S: this.getMilliseconds()
  };
  for (var r in /(y+)/.test(t) && (t = t.replace(RegExp.$1, "".concat(this.getFullYear()).substr(4 - RegExp.$1.length))), 
  e) new RegExp("(".concat(r, ")")).test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? e[r] : "00".concat(e[r]).substr("".concat(e[r]).length)));
  return t;
};

var strToTime = function(t) {
  return t = t.replace(/-/g, "/"), new Date(t).getTime();
};

exports.strToTime = strToTime;

var dateToStr = function(t) {
  return new Date(t).format("yyyy-MM-dd hh:mm:ss");
};

exports.dateToStr = dateToStr;

var dateToMouthDay = function(t) {
  return new Date(t).format("MM-dd");
};

exports.dateToMouthDay = dateToMouthDay;

var dateToHourMi = function(t) {
  return new Date(t).format("hh:mm");
};

exports.dateToHourMi = dateToHourMi;

var dateToHour = function(t) {
  var e = new Date(t).format("yyyy-MM-dd hh");
  return e = "".concat(e, ":00:00");
};

exports.dateToHour = dateToHour;

var currentDate = function() {
  return (new Date).format("yyyy-MM-dd");
};

exports.currentDate = currentDate;

var currentLongDate = function() {
  return (new Date).format("yyyy-MM-dd hh:mm:ss");
};

exports.currentLongDate = currentLongDate;

var currentDateHm = function() {
  return (new Date).format("hh时mm分");
};

exports.currentDateHm = currentDateHm;

var currentDateMdhms = function() {
  return (new Date).format("MM-dd hh:mm:ss");
};

exports.currentDateMdhms = currentDateMdhms;

var dateToNoYS = function(t) {
  return new Date(t).format("MM-dd hh:mm");
};

exports.dateToNoYS = dateToNoYS;

var formatSeconds = function(t) {
  var e = "";
  if (t) {
    var r, o, a = parseInt(t);
    o = parseInt(a / 3600), r = parseInt(a % 3600 / 60), e = "".concat(o, "小时 ").concat(r, "分钟");
  } else e = "请开始分析！";
  return e;
};

exports.formatSeconds = formatSeconds;