timestring/dist/timestring.min.js
Michael Barrett 678d330ac7 use jQuery cs
2015-05-05 11:05:32 +01:00

2 lines
29 KiB
JavaScript

!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Timestring=e()}}(function(){return function e(t,n,r){function i(u,o){if(!n[u]){if(!t[u]){var a="function"==typeof require&&require;if(!o&&a)return a(u,!0);if(s)return s(u,!0);var f=new Error("Cannot find module '"+u+"'");throw f.code="MODULE_NOT_FOUND",f}var h=n[u]={exports:{}};t[u][0].call(h.exports,function(e){var n=t[u][1][e];return i(n?n:e)},h,h.exports,e,t,n,r)}return n[u].exports}for(var s="function"==typeof require&&require,u=0;u<r.length;u++)i(r[u]);return i}({1:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(){function e(){var t=void 0===arguments[0]?{}:arguments[0];r(this,e);var n={hoursPerDay:24,daysPerWeek:7,weeksPerMonth:4,monthsPerYear:12};this.settings=n;for(var i in t)this.settings[i]=t[i];this.units={s:["s","sec","secs","second","seconds"],m:["m","min","mins","minute","minutes"],h:["h","hr","hrs","hour","hours"],d:["d","day","days"],w:["w","week","weeks"],mth:["mth","mths","month","months"],y:["y","yr","yrs","year","years"]},this.unitValues={s:1,m:60,h:3600},this.unitValues.d=this.settings.hoursPerDay*this.unitValues.h,this.unitValues.w=this.settings.daysPerWeek*this.unitValues.d,this.unitValues.mth=this.settings.weeksPerMonth*this.unitValues.w,this.unitValues.y=this.settings.monthsPerYear*this.unitValues.mth}return i(e,[{key:"parse",value:function(e){var t=this,n=void 0===arguments[1]?"s":arguments[1],r=function(e){for(var n in t.units)for(var r in t.units[n])if(e===t.units[n][r])return n;throw new Error("The unit ["+e+"] is not supported by timestring")},i=function(e,n){var i=t.unitValues[r(n)];return e/i},s=function(e,n){var i=t.unitValues[r(n)];return e*i},u=0,o=e.toLowerCase().replace(/[^\.\w+-]+/g,"").match(/[-+]?[0-9]+[a-z]+/g);if(null!==o)for(var a in o){var f=o[a],h=f.match(/[0-9]+/g)[0],l=f.match(/[a-z]+/g)[0];u+=s(h,l)}return i(u,n)}}]),e}();n["default"]=s,String.prototype.parseTime=function(e,t){return new s(t).parse(this,e)},t.exports=n["default"]},{}]},{},[1])(1)});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyaWZ5L25vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJ0aW1lc3RyaW5nLmpzIiwiVGltZXN0cmluZy5qcyJdLCJuYW1lcyI6WyJmIiwiZXhwb3J0cyIsIm1vZHVsZSIsImRlZmluZSIsImFtZCIsImciLCJ3aW5kb3ciLCJnbG9iYWwiLCJzZWxmIiwidGhpcyIsIlRpbWVzdHJpbmciLCJlIiwidCIsIm4iLCJyIiwicyIsIm8iLCJ1IiwiYSIsInJlcXVpcmUiLCJpIiwiRXJyb3IiLCJjb2RlIiwibCIsImNhbGwiLCJsZW5ndGgiLDEsIl9jbGFzc0NhbGxDaGVjayIsImluc3RhbmNlIiwiQ29uc3RydWN0b3IiLCJUeXBlRXJyb3IiLCJPYmplY3QiLCJkZWZpbmVQcm9wZXJ0eSIsInZhbHVlIiwiX2NyZWF0ZUNsYXNzIiwiZGVmaW5lUHJvcGVydGllcyIsInRhcmdldCIsInByb3BzIiwiZGVzY3JpcHRvciIsImVudW1lcmFibGUiLCJjb25maWd1cmFibGUiLCJ3cml0YWJsZSIsImtleSIsInByb3RvUHJvcHMiL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