(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[117],{

/***/ "./src/utils/date.js":
/*!***************************!*\
  !*** ./src/utils/date.js ***!
  \***************************/
/*! exports provided: fromNow, normalize, fromJson, toReadable, toReadableDate, convert, duration */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromNow\", function() { return fromNow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"normalize\", function() { return normalize; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromJson\", function() { return fromJson; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toReadable\", function() { return toReadable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toReadableDate\", function() { return toReadableDate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"convert\", function() { return convert; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"duration\", function() { return duration; });\n/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! moment */ \"./node_modules/moment/moment.js\");\n/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_0__);\n\nfunction fromNow(date) {\n  if (date) return moment__WEBPACK_IMPORTED_MODULE_0___default()(normalize(date)).fromNow();else return \"\";\n}\nfunction normalize(date) {\n  if (date && typeof date === \"string\" && !date.includes(\":\")) return parseInt(date);else return date;\n}\nfunction fromJson(jsonDate) {\n  var offset = new Date().getTimezoneOffset();\n  var parts = /\\/Date\\((-?\\d+)([+-]\\d{2})?(\\d{2})?.*/.exec(jsonDate);\n  if (parts[2] == undefined) parts[2] = 0;\n  if (parts[3] == undefined) parts[3] = 0;\n  return new Date(+parts[1] + offset + parts[2] * 3600000 + parts[3] * 60000);\n}\nfunction toReadable(date) {\n  if (date) {\n    date = convert(normalize(date));\n    return date.toLocaleDateString([], {\n      //weekday: \"narrow\",\n      year: \"numeric\",\n      month: \"numeric\",\n      day: \"numeric\",\n      hour: \"numeric\",\n      minute: \"numeric\",\n      hour12: false\n    });\n  }\n  return \"\";\n}\nfunction toReadableDate(date) {\n  if (date && date != \"\") {\n    date = convert(normalize(date));\n    return date.toLocaleDateString();\n  }\n  return \"\";\n}\nfunction convert(dateStr) {\n  if (dateStr) {\n    const dateObj = new Date(dateStr);\n    return dateObj;\n  }\n  return null;\n}\nfunction duration(date1, date2) {\n  const start = moment__WEBPACK_IMPORTED_MODULE_0___default()(date1);\n  const end = moment__WEBPACK_IMPORTED_MODULE_0___default()(date2);\n  const duration = end.diff(start, \"minutes\", true);\n  return +(Math.round(duration + \"e+2\") + \"e-2\");\n}\n\n//# sourceURL=webpack:///./src/utils/date.js?");

/***/ })

}]);