Changeset 28459
- Timestamp:
- 01/15/09 23:45:05 (4 years ago)
- Files:
-
- 1 modified
-
lang/javascript/userscripts/jautopagerize.user.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/userscripts/jautopagerize.user.js
r28429 r28459 790 790 function duration (str) { 791 791 var ret = 0, map = { 792 sec : 1 , min : 60, hour : 3600, day : 86400, week : 604800, month : 2592000, year : 31536000792 sec : 1000, min : 60000, hour : 3600000, day : 86400000, week : 604800000, month : 2592000000, year : 31536000000 793 793 }; 794 str.replace(/( \d+)\s*(msec|sec|min|hour|day|week|month|year)s?/g, function (_, num, unit) {795 ret += +num * map[unit];794 str.replace(/([-+]?\d+)\s*((?:m(?:illi)?)?sec|min|hour|day|week|month|year|)/g, function (_, num, unit) { 795 ret += +num * (map[unit] || 1); 796 796 }); 797 return ret * 1000;797 return ret; 798 798 } 799 799
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)