path: root/gitweb/Makefile
diff options
authorJakub Narebski <>2011-04-28 19:04:04 (GMT)
committerJunio C Hamano <>2011-05-24 18:22:44 (GMT)
commit54b1479a770b240d71bbd000fb40e470987bac59 (patch)
treedce365645d38f6f3c00878ccf4a14ee0af39ec54 /gitweb/Makefile
parent4dfa207eec44e0d8869c4978cf3d9861aaf40091 (diff)
gitweb.js: Extract and improve datetime handling
Move formatDateISOLocal(epoch, timezone) function (and also helper timezoneOffset(timezoneInfo) function it requires) from common-lib.js to datetime.js Add new functions: * localTimezoneOffset - to get browser timezone offset in seconds * localTimezoneInfo - to get browser timezone in '(+|-)HHMM' format * formatTimezoneInfo - turn offset in hours and minutes into '(+|-)HHMM' * parseRFC2822Date - to parse RFC-2822 dates that gitweb uses into epoch * formatDateRFC2882 - like formatDateISOLocal, only RFC-2822 format All those functions are meant to be used in future commit 'gitweb: javascript ability to adjust time based on timezone' An alternative would be to use e.g. Datejs ( library, or JavaScript framework that has date formatting (perhaps as a plugin). While at it escape '-' in character class inside tzRe regexp, as recommended by JSLint ( Signed-off-by: Jakub Narebski <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'gitweb/Makefile')
1 files changed, 1 insertions, 0 deletions
diff --git a/gitweb/Makefile b/gitweb/Makefile
index 0baa9df..403265a 100644
--- a/gitweb/Makefile
+++ b/gitweb/Makefile
@@ -117,6 +117,7 @@ GITWEB_FILES += static/git-logo.png static/git-favicon.png
# js/lib/common-lib.js should be always first, then js/lib/*.js,
# then the rest of files; js/gitweb.js should be last (if it exists)
GITWEB_JSLIB_FILES += static/js/lib/common-lib.js
+GITWEB_JSLIB_FILES += static/js/lib/datetime.js
GITWEB_JSLIB_FILES += static/js/javascript-detection.js
GITWEB_JSLIB_FILES += static/js/blame_incremental.js