mirror of https://github.com/zulip/zulip.git
Zero-pad hour and minute
(imported from commit 404600ce3cb2233acb1b2e69cdd87c64604d9826)
This commit is contained in:
parent
d6d4bcd192
commit
7d4fd5b14f
|
@ -484,7 +484,9 @@ function add_message(index, zephyr) {
|
|||
zephyr.html_content = newline2br(zephyr.content);
|
||||
|
||||
var time = new Date(zephyr.timestamp * 1000);
|
||||
zephyr.timestr = time.getHours() + ':' + time.getMinutes();
|
||||
var two_digits = function (x) { return ('0' + x).slice(-2); }
|
||||
zephyr.timestr = two_digits(time.getHours())
|
||||
+ ':' + two_digits(time.getMinutes());
|
||||
|
||||
var new_tr = $('<tr />').attr('id', zephyr.id).addClass('zephyr_row');
|
||||
$('#table').append(new_tr);
|
||||
|
|
Loading…
Reference in New Issue