From bbc83634d485359367fc4ad9d21cc1e9a63b01e1 Mon Sep 17 00:00:00 2001 From: Amr Labib Date: Fri, 18 Jun 2021 17:59:03 +0200 Subject: [PATCH] update docs file --- docs/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/index.js b/docs/index.js index 2b9bbff..a33a91c 100644 --- a/docs/index.js +++ b/docs/index.js @@ -94,7 +94,7 @@ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _templateObject = _taggedTemplateLiteral(['\\n html, body {\\n margin: 0;\\n font-family: Arial;\\n text-align: left;\\n color: #404549;\\n }\\n h2 {\\n margin-top: 20px;\\n }\\n'], ['\\n html, body {\\n margin: 0;\\n font-family: Arial;\\n text-align: left;\\n color: #404549;\\n }\\n h2 {\\n margin-top: 20px;\\n }\\n']),\n _templateObject2 = _taggedTemplateLiteral(['\\n width: 1170px;\\n margin-left: auto;\\n margin-right: auto;\\n'], ['\\n width: 1170px;\\n margin-left: auto;\\n margin-right: auto;\\n']),\n _templateObject3 = _taggedTemplateLiteral(['\\n background-color: #404549;\\n'], ['\\n background-color: #404549;\\n']),\n _templateObject4 = _taggedTemplateLiteral(['\\n display: flex;\\n justify-content: space-between;\\n align-items: center;\\n & h1 {\\n margin: 20px 0;\\n }\\n'], ['\\n display: flex;\\n justify-content: space-between;\\n align-items: center;\\n & h1 {\\n margin: 20px 0;\\n }\\n']),\n _templateObject5 = _taggedTemplateLiteral(['\\n color: white;\\n'], ['\\n color: white;\\n']),\n _templateObject6 = _taggedTemplateLiteral(['\\n height: 0px;\\n margin-top: 30px;\\n border: dashed 2px #404549;\\n'], ['\\n height: 0px;\\n margin-top: 30px;\\n border: dashed 2px #404549;\\n']);\n\nexports.default = App;\n\nvar _react = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _styledComponents = __webpack_require__(/*! styled-components */ \"./node_modules/styled-components/dist/styled-components.browser.esm.js\");\n\nvar _styledComponents2 = _interopRequireDefault(_styledComponents);\n\nvar _UseTimerDemo = __webpack_require__(/*! ./components/UseTimerDemo */ \"./demo/components/UseTimerDemo.js\");\n\nvar _UseTimerDemo2 = _interopRequireDefault(_UseTimerDemo);\n\nvar _UseStopwatchDemo = __webpack_require__(/*! ./components/UseStopwatchDemo */ \"./demo/components/UseStopwatchDemo.js\");\n\nvar _UseStopwatchDemo2 = _interopRequireDefault(_UseStopwatchDemo);\n\nvar _UseTimeDemo = __webpack_require__(/*! ./components/UseTimeDemo */ \"./demo/components/UseTimeDemo.js\");\n\nvar _UseTimeDemo2 = _interopRequireDefault(_UseTimeDemo);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }\n\nvar GlobalStyle = (0, _styledComponents.createGlobalStyle)(_templateObject);\n\nvar Container = _styledComponents2.default.div(_templateObject2);\n\nvar HeaderBG = _styledComponents2.default.div(_templateObject3);\n\nvar Header = _styledComponents2.default.div(_templateObject4);\n\nvar H1 = _styledComponents2.default.h1(_templateObject5);\n\nvar Separator = _styledComponents2.default.div(_templateObject6);\n\nfunction App() {\n var time = new Date();\n time.setSeconds(time.getSeconds() + 600); // 10 minutes timer\n\n var stopwatchOffset = new Date();\n stopwatchOffset.setSeconds(stopwatchOffset.getSeconds() + 10);\n return _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(GlobalStyle, null),\n _react2.default.createElement(\n HeaderBG,\n null,\n _react2.default.createElement(\n Container,\n null,\n _react2.default.createElement(\n Header,\n null,\n _react2.default.createElement(\n H1,\n null,\n 'react-timer-hook'\n ),\n _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement('iframe', { src: 'https://ghbtns.com/github-btn.html?user=amrlabib&repo=react-timer-hook&type=star&count=true&size=large', frameborder: '0', scrolling: '0', width: '160', height: '30', title: 'GitHub' }),\n _react2.default.createElement('iframe', { src: 'https://ghbtns.com/github-btn.html?user=amrlabib&repo=react-timer-hook&type=fork&count=true&size=large', frameborder: '0', scrolling: '0', width: '126', height: '30', title: 'GitHub' })\n )\n )\n )\n ),\n _react2.default.createElement(\n Container,\n null,\n _react2.default.createElement(\n 'p',\n null,\n 'React timer hook is a custom ',\n _react2.default.createElement(\n 'a',\n { href: 'https://reactjs.org/docs/hooks-intro.html', target: '_blank' },\n 'react hook'\n ),\n ' built to handle timer, stopwatch, and time logic/state in your react component.'\n ),\n _react2.default.createElement(_UseTimerDemo2.default, { expiryTimestamp: time }),\n _react2.default.createElement(Separator, null),\n _react2.default.createElement(_UseStopwatchDemo2.default, { offsetTimestamp: stopwatchOffset }),\n _react2.default.createElement(Separator, null),\n _react2.default.createElement(_UseTimeDemo2.default, null)\n )\n );\n}\n\n//# sourceURL=webpack:///./demo/App.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _templateObject = _taggedTemplateLiteral(['\\n html, body {\\n margin: 0;\\n font-family: Arial;\\n text-align: left;\\n color: #404549;\\n }\\n h2 {\\n margin-top: 20px;\\n }\\n'], ['\\n html, body {\\n margin: 0;\\n font-family: Arial;\\n text-align: left;\\n color: #404549;\\n }\\n h2 {\\n margin-top: 20px;\\n }\\n']),\n _templateObject2 = _taggedTemplateLiteral(['\\n width: 1170px;\\n margin-left: auto;\\n margin-right: auto;\\n'], ['\\n width: 1170px;\\n margin-left: auto;\\n margin-right: auto;\\n']),\n _templateObject3 = _taggedTemplateLiteral(['\\n background-color: #404549;\\n'], ['\\n background-color: #404549;\\n']),\n _templateObject4 = _taggedTemplateLiteral(['\\n display: flex;\\n justify-content: space-between;\\n align-items: center;\\n & h1 {\\n margin: 20px 0;\\n }\\n'], ['\\n display: flex;\\n justify-content: space-between;\\n align-items: center;\\n & h1 {\\n margin: 20px 0;\\n }\\n']),\n _templateObject5 = _taggedTemplateLiteral(['\\n color: white;\\n'], ['\\n color: white;\\n']),\n _templateObject6 = _taggedTemplateLiteral(['\\n height: 0px;\\n margin-top: 30px;\\n border: dashed 2px #404549;\\n'], ['\\n height: 0px;\\n margin-top: 30px;\\n border: dashed 2px #404549;\\n']);\n\nexports.default = App;\n\nvar _react = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _styledComponents = __webpack_require__(/*! styled-components */ \"./node_modules/styled-components/dist/styled-components.browser.esm.js\");\n\nvar _styledComponents2 = _interopRequireDefault(_styledComponents);\n\nvar _UseTimerDemo = __webpack_require__(/*! ./components/UseTimerDemo */ \"./demo/components/UseTimerDemo.js\");\n\nvar _UseTimerDemo2 = _interopRequireDefault(_UseTimerDemo);\n\nvar _UseStopwatchDemo = __webpack_require__(/*! ./components/UseStopwatchDemo */ \"./demo/components/UseStopwatchDemo.js\");\n\nvar _UseStopwatchDemo2 = _interopRequireDefault(_UseStopwatchDemo);\n\nvar _UseTimeDemo = __webpack_require__(/*! ./components/UseTimeDemo */ \"./demo/components/UseTimeDemo.js\");\n\nvar _UseTimeDemo2 = _interopRequireDefault(_UseTimeDemo);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }\n\nvar GlobalStyle = (0, _styledComponents.createGlobalStyle)(_templateObject);\n\nvar Container = _styledComponents2.default.div(_templateObject2);\n\nvar HeaderBG = _styledComponents2.default.div(_templateObject3);\n\nvar Header = _styledComponents2.default.div(_templateObject4);\n\nvar H1 = _styledComponents2.default.h1(_templateObject5);\n\nvar Separator = _styledComponents2.default.div(_templateObject6);\n\nfunction App() {\n var time = new Date();\n time.setSeconds(time.getSeconds() + 600); // 10 minutes timer\n return _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(GlobalStyle, null),\n _react2.default.createElement(\n HeaderBG,\n null,\n _react2.default.createElement(\n Container,\n null,\n _react2.default.createElement(\n Header,\n null,\n _react2.default.createElement(\n H1,\n null,\n 'react-timer-hook'\n ),\n _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement('iframe', { src: 'https://ghbtns.com/github-btn.html?user=amrlabib&repo=react-timer-hook&type=star&count=true&size=large', frameborder: '0', scrolling: '0', width: '160', height: '30', title: 'GitHub' }),\n _react2.default.createElement('iframe', { src: 'https://ghbtns.com/github-btn.html?user=amrlabib&repo=react-timer-hook&type=fork&count=true&size=large', frameborder: '0', scrolling: '0', width: '126', height: '30', title: 'GitHub' })\n )\n )\n )\n ),\n _react2.default.createElement(\n Container,\n null,\n _react2.default.createElement(\n 'p',\n null,\n 'React timer hook is a custom ',\n _react2.default.createElement(\n 'a',\n { href: 'https://reactjs.org/docs/hooks-intro.html', target: '_blank' },\n 'react hook'\n ),\n ' built to handle timer, stopwatch, and time logic/state in your react component.'\n ),\n _react2.default.createElement(_UseTimerDemo2.default, { expiryTimestamp: time }),\n _react2.default.createElement(Separator, null),\n _react2.default.createElement(_UseStopwatchDemo2.default, null),\n _react2.default.createElement(Separator, null),\n _react2.default.createElement(_UseTimeDemo2.default, null)\n )\n );\n}\n\n//# sourceURL=webpack:///./demo/App.js?"); /***/ }), @@ -142,7 +142,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = UseStopwatchDemo;\n\nvar _react = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _index = __webpack_require__(/*! ../../src/index */ \"./src/index.js\");\n\nvar _Button = __webpack_require__(/*! ./Button */ \"./demo/components/Button.js\");\n\nvar _Button2 = _interopRequireDefault(_Button);\n\nvar _TimerStyled = __webpack_require__(/*! ./TimerStyled */ \"./demo/components/TimerStyled.js\");\n\nvar _TimerStyled2 = _interopRequireDefault(_TimerStyled);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction UseStopwatchDemo(_ref) {\n var offsetTimestamp = _ref.offsetTimestamp;\n\n var _useStopwatch = (0, _index.useStopwatch)({ autoStart: true, offsetTimestamp: offsetTimestamp }),\n seconds = _useStopwatch.seconds,\n minutes = _useStopwatch.minutes,\n hours = _useStopwatch.hours,\n days = _useStopwatch.days,\n start = _useStopwatch.start,\n pause = _useStopwatch.pause,\n reset = _useStopwatch.reset;\n\n return _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(\n 'h2',\n null,\n 'UseStopwatch Demo'\n ),\n _react2.default.createElement(_TimerStyled2.default, { seconds: seconds, minutes: minutes, hours: hours, days: days }),\n _react2.default.createElement(\n _Button2.default,\n { onClick: start },\n 'Start'\n ),\n _react2.default.createElement(\n _Button2.default,\n { onClick: pause },\n 'Pause'\n ),\n _react2.default.createElement(\n _Button2.default,\n { onClick: reset },\n 'Reset'\n )\n );\n}\n\n//# sourceURL=webpack:///./demo/components/UseStopwatchDemo.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = UseStopwatchDemo;\n\nvar _react = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _index = __webpack_require__(/*! ../../src/index */ \"./src/index.js\");\n\nvar _Button = __webpack_require__(/*! ./Button */ \"./demo/components/Button.js\");\n\nvar _Button2 = _interopRequireDefault(_Button);\n\nvar _TimerStyled = __webpack_require__(/*! ./TimerStyled */ \"./demo/components/TimerStyled.js\");\n\nvar _TimerStyled2 = _interopRequireDefault(_TimerStyled);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction UseStopwatchDemo() {\n var _useStopwatch = (0, _index.useStopwatch)({ autoStart: true }),\n seconds = _useStopwatch.seconds,\n minutes = _useStopwatch.minutes,\n hours = _useStopwatch.hours,\n days = _useStopwatch.days,\n start = _useStopwatch.start,\n pause = _useStopwatch.pause,\n reset = _useStopwatch.reset;\n\n return _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(\n 'h2',\n null,\n 'UseStopwatch Demo'\n ),\n _react2.default.createElement(_TimerStyled2.default, { seconds: seconds, minutes: minutes, hours: hours, days: days }),\n _react2.default.createElement(\n _Button2.default,\n { onClick: start },\n 'Start'\n ),\n _react2.default.createElement(\n _Button2.default,\n { onClick: pause },\n 'Pause'\n ),\n _react2.default.createElement(\n _Button2.default,\n { onClick: reset },\n 'Reset'\n )\n );\n}\n\n//# sourceURL=webpack:///./demo/components/UseStopwatchDemo.js?"); /***/ }), @@ -487,7 +487,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nexports.default = useStopwatch;\n\nvar _react = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n\nvar _utils = __webpack_require__(/*! ./utils */ \"./src/utils/index.js\");\n\nvar _hooks = __webpack_require__(/*! ./hooks */ \"./src/hooks/index.js\");\n\nfunction useStopwatch(_ref) {\n var autoStart = _ref.autoStart,\n offsetTimestamp = _ref.offsetTimestamp;\n\n var _useState = (0, _react.useState)(_utils.Time.getSecondsFromExpiry(offsetTimestamp) || 0),\n _useState2 = _slicedToArray(_useState, 2),\n passedSeconds = _useState2[0],\n setPassedSeconds = _useState2[1];\n\n var _useState3 = (0, _react.useState)(new Date()),\n _useState4 = _slicedToArray(_useState3, 2),\n prevTime = _useState4[0],\n setPrevTime = _useState4[1];\n\n var _useState5 = (0, _react.useState)(passedSeconds + _utils.Time.getSecondsFromPrevTime(prevTime || 0)),\n _useState6 = _slicedToArray(_useState5, 2),\n seconds = _useState6[0],\n setSeconds = _useState6[1];\n\n var _useState7 = (0, _react.useState)(autoStart),\n _useState8 = _slicedToArray(_useState7, 2),\n isRunning = _useState8[0],\n setIsRunning = _useState8[1];\n\n (0, _hooks.useInterval)(function () {\n setSeconds(passedSeconds + _utils.Time.getSecondsFromPrevTime(prevTime));\n }, isRunning ? 1000 : null);\n\n function start() {\n var newPrevTime = new Date();\n setPrevTime(newPrevTime);\n setIsRunning(true);\n setSeconds(passedSeconds + _utils.Time.getSecondsFromPrevTime(newPrevTime));\n }\n\n function pause() {\n setPassedSeconds(seconds);\n setIsRunning(false);\n }\n\n function reset() {\n var offset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var newAutoStart = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n\n var newPassedSeconds = _utils.Time.getSecondsFromExpiry(offset) || 0;\n var newPrevTime = new Date();\n setPrevTime(newPrevTime);\n setPassedSeconds(newPassedSeconds);\n setIsRunning(newAutoStart);\n setSeconds(newPassedSeconds + _utils.Time.getSecondsFromPrevTime(newPrevTime));\n }\n\n return _extends({}, _utils.Time.getTimeFromSeconds(seconds, true), { start: start, pause: pause, reset: reset, isRunning: isRunning\n });\n}\n\n//# sourceURL=webpack:///./src/useStopwatch.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nexports.default = useStopwatch;\n\nvar _react = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n\nvar _utils = __webpack_require__(/*! ./utils */ \"./src/utils/index.js\");\n\nvar _hooks = __webpack_require__(/*! ./hooks */ \"./src/hooks/index.js\");\n\nfunction useStopwatch(_ref) {\n var autoStart = _ref.autoStart,\n offsetTimestamp = _ref.offsetTimestamp;\n\n var _useState = (0, _react.useState)(_utils.Time.getSecondsFromExpiry(offsetTimestamp, true) || 0),\n _useState2 = _slicedToArray(_useState, 2),\n passedSeconds = _useState2[0],\n setPassedSeconds = _useState2[1];\n\n var _useState3 = (0, _react.useState)(new Date()),\n _useState4 = _slicedToArray(_useState3, 2),\n prevTime = _useState4[0],\n setPrevTime = _useState4[1];\n\n var _useState5 = (0, _react.useState)(passedSeconds + _utils.Time.getSecondsFromPrevTime(prevTime || 0, true)),\n _useState6 = _slicedToArray(_useState5, 2),\n seconds = _useState6[0],\n setSeconds = _useState6[1];\n\n var _useState7 = (0, _react.useState)(autoStart),\n _useState8 = _slicedToArray(_useState7, 2),\n isRunning = _useState8[0],\n setIsRunning = _useState8[1];\n\n (0, _hooks.useInterval)(function () {\n setSeconds(passedSeconds + _utils.Time.getSecondsFromPrevTime(prevTime, true));\n }, isRunning ? 1000 : null);\n\n function start() {\n var newPrevTime = new Date();\n setPrevTime(newPrevTime);\n setIsRunning(true);\n setSeconds(passedSeconds + _utils.Time.getSecondsFromPrevTime(newPrevTime, true));\n }\n\n function pause() {\n setPassedSeconds(seconds);\n setIsRunning(false);\n }\n\n function reset() {\n var offset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var newAutoStart = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n\n var newPassedSeconds = _utils.Time.getSecondsFromExpiry(offset, true) || 0;\n var newPrevTime = new Date();\n setPrevTime(newPrevTime);\n setPassedSeconds(newPassedSeconds);\n setIsRunning(newAutoStart);\n setSeconds(newPassedSeconds + _utils.Time.getSecondsFromPrevTime(newPrevTime, true));\n }\n\n return _extends({}, _utils.Time.getTimeFromSeconds(seconds), { start: start, pause: pause, reset: reset, isRunning: isRunning\n });\n}\n\n//# sourceURL=webpack:///./src/useStopwatch.js?"); /***/ }), @@ -523,7 +523,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Time = function () {\n function Time() {\n _classCallCheck(this, Time);\n }\n\n _createClass(Time, null, [{\n key: 'getTimeFromSeconds',\n value: function getTimeFromSeconds(secs, floorRounding) {\n var totalSeconds = floorRounding ? Math.floor(secs) : Math.ceil(secs);\n var days = Math.floor(totalSeconds / (60 * 60 * 24));\n var hours = Math.floor(totalSeconds % (60 * 60 * 24) / (60 * 60));\n var minutes = Math.floor(totalSeconds % (60 * 60) / 60);\n var seconds = Math.floor(totalSeconds % 60);\n\n return {\n seconds: seconds,\n minutes: minutes,\n hours: hours,\n days: days\n };\n }\n }, {\n key: 'getSecondsFromExpiry',\n value: function getSecondsFromExpiry(expiry) {\n var now = new Date().getTime();\n var milliSecondsDistance = expiry - now;\n if (milliSecondsDistance > 0) {\n return milliSecondsDistance / 1000;\n }\n return 0;\n }\n }, {\n key: 'getSecondsFromPrevTime',\n value: function getSecondsFromPrevTime(prevTime) {\n var now = new Date().getTime();\n var milliSecondsDistance = now - prevTime;\n if (milliSecondsDistance > 0) {\n return milliSecondsDistance / 1000;\n }\n return 0;\n }\n }, {\n key: 'getSecondsFromTimeNow',\n value: function getSecondsFromTimeNow() {\n var now = new Date();\n var currentTimestamp = now.getTime();\n var offset = now.getTimezoneOffset() * 60;\n return currentTimestamp / 1000 - offset;\n }\n }, {\n key: 'getFormattedTimeFromSeconds',\n value: function getFormattedTimeFromSeconds(totalSeconds, format) {\n var _Time$getTimeFromSeco = Time.getTimeFromSeconds(totalSeconds),\n secondsValue = _Time$getTimeFromSeco.seconds,\n minutes = _Time$getTimeFromSeco.minutes,\n hours = _Time$getTimeFromSeco.hours;\n\n var ampm = '';\n var hoursValue = hours;\n\n if (format === '12-hour') {\n ampm = hours >= 12 ? 'pm' : 'am';\n hoursValue = hours % 12;\n }\n\n return {\n seconds: secondsValue,\n minutes: minutes,\n hours: hoursValue,\n ampm: ampm\n };\n }\n }]);\n\n return Time;\n}();\n\nexports.default = Time;\n\n//# sourceURL=webpack:///./src/utils/Time.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Time = function () {\n function Time() {\n _classCallCheck(this, Time);\n }\n\n _createClass(Time, null, [{\n key: 'getTimeFromSeconds',\n value: function getTimeFromSeconds(secs) {\n var totalSeconds = Math.ceil(secs);\n var days = Math.floor(totalSeconds / (60 * 60 * 24));\n var hours = Math.floor(totalSeconds % (60 * 60 * 24) / (60 * 60));\n var minutes = Math.floor(totalSeconds % (60 * 60) / 60);\n var seconds = Math.floor(totalSeconds % 60);\n\n return {\n seconds: seconds,\n minutes: minutes,\n hours: hours,\n days: days\n };\n }\n }, {\n key: 'getSecondsFromExpiry',\n value: function getSecondsFromExpiry(expiry, shouldRound) {\n var now = new Date().getTime();\n var milliSecondsDistance = expiry - now;\n if (milliSecondsDistance > 0) {\n var val = milliSecondsDistance / 1000;\n return shouldRound ? Math.round(val) : val;\n }\n return 0;\n }\n }, {\n key: 'getSecondsFromPrevTime',\n value: function getSecondsFromPrevTime(prevTime, shouldRound) {\n var now = new Date().getTime();\n var milliSecondsDistance = now - prevTime;\n if (milliSecondsDistance > 0) {\n var val = milliSecondsDistance / 1000;\n return shouldRound ? Math.round(val) : val;\n }\n return 0;\n }\n }, {\n key: 'getSecondsFromTimeNow',\n value: function getSecondsFromTimeNow() {\n var now = new Date();\n var currentTimestamp = now.getTime();\n var offset = now.getTimezoneOffset() * 60;\n return currentTimestamp / 1000 - offset;\n }\n }, {\n key: 'getFormattedTimeFromSeconds',\n value: function getFormattedTimeFromSeconds(totalSeconds, format) {\n var _Time$getTimeFromSeco = Time.getTimeFromSeconds(totalSeconds),\n secondsValue = _Time$getTimeFromSeco.seconds,\n minutes = _Time$getTimeFromSeco.minutes,\n hours = _Time$getTimeFromSeco.hours;\n\n var ampm = '';\n var hoursValue = hours;\n\n if (format === '12-hour') {\n ampm = hours >= 12 ? 'pm' : 'am';\n hoursValue = hours % 12;\n }\n\n return {\n seconds: secondsValue,\n minutes: minutes,\n hours: hoursValue,\n ampm: ampm\n };\n }\n }]);\n\n return Time;\n}();\n\nexports.default = Time;\n\n//# sourceURL=webpack:///./src/utils/Time.js?"); /***/ }),