summaryrefslogtreecommitdiff
path: root/gitweb/static/js/lib/common-lib.js
diff options
context:
space:
mode:
Diffstat (limited to 'gitweb/static/js/lib/common-lib.js')
-rw-r--r--gitweb/static/js/lib/common-lib.js51
1 files changed, 0 insertions, 51 deletions
diff --git a/gitweb/static/js/lib/common-lib.js b/gitweb/static/js/lib/common-lib.js
index c45454e..d6b0c0d 100644
--- a/gitweb/static/js/lib/common-lib.js
+++ b/gitweb/static/js/lib/common-lib.js
@@ -89,57 +89,6 @@ function createRequestObject() {
/* ............................................................ */
-/* time and data */
-
-/**
- * used to extract hours and minutes from timezone info, e.g '-0900'
- * @constant
- */
-var tzRe = /^([+-])([0-9][0-9])([0-9][0-9])$/;
-
-/**
- * convert numeric timezone +/-ZZZZ to offset from UTC in seconds
- *
- * @param {String} timezoneInfo: numeric timezone '(+|-)HHMM'
- * @returns {Number} offset from UTC in seconds for timezone
- *
- * @globals tzRe
- */
-function timezoneOffset(timezoneInfo) {
- var match = tzRe.exec(timezoneInfo);
- var tz_sign = (match[1] === '-' ? -1 : +1);
- var tz_hour = parseInt(match[2],10);
- var tz_min = parseInt(match[3],10);
-
- return tz_sign*(((tz_hour*60) + tz_min)*60);
-}
-
-/**
- * return date in local time formatted in iso-8601 like format
- * 'yyyy-mm-dd HH:MM:SS +/-ZZZZ' e.g. '2005-08-07 21:49:46 +0200'
- *
- * @param {Number} epoch: seconds since '00:00:00 1970-01-01 UTC'
- * @param {String} timezoneInfo: numeric timezone '(+|-)HHMM'
- * @returns {String} date in local time in iso-8601 like format
- */
-function formatDateISOLocal(epoch, timezoneInfo) {
- // date corrected by timezone
- var localDate = new Date(1000 * (epoch +
- timezoneOffset(timezoneInfo)));
- var localDateStr = // e.g. '2005-08-07'
- localDate.getUTCFullYear() + '-' +
- padLeft(localDate.getUTCMonth()+1, 2, '0') + '-' +
- padLeft(localDate.getUTCDate(), 2, '0');
- var localTimeStr = // e.g. '21:49:46'
- padLeft(localDate.getUTCHours(), 2, '0') + ':' +
- padLeft(localDate.getUTCMinutes(), 2, '0') + ':' +
- padLeft(localDate.getUTCSeconds(), 2, '0');
-
- return localDateStr + ' ' + localTimeStr + ' ' + timezoneInfo;
-}
-
-
-/* ............................................................ */
/* unquoting/unescaping filenames */
/**#@+