diff options
author | Jakub Narebski <jnareb@gmail.com> | 2011-04-28 21:04:04 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-05-24 11:22:44 -0700 |
commit | 54b1479a770b240d71bbd000fb40e470987bac59 (patch) | |
tree | dce365645d38f6f3c00878ccf4a14ee0af39ec54 /contrib/blameview | |
parent | gitweb.js: Provide default values for padding in padLeftStr and padLeft (diff) | |
download | tgif-54b1479a770b240d71bbd000fb40e470987bac59.tar.xz |
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 (http://www.datejs.com)
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 (http://www.jslint.com).
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/blameview')
0 files changed, 0 insertions, 0 deletions