function pad(n) {
    return n > 9 ? n.toString() : '0' + n;
}

function dateToStringTimestamp(date) {
    return pad(date.getHours())
        + ':' + pad(date.getMinutes())
        + ':' + pad(date.getSeconds());
}

$(function() {
    'use strict';

    var $controls = $('.controls');
    if(!$controls.length) {
        return;
    }

    var $logs = $('#logs');

    function hideEvents(events) {
        $logs.attr('data-event-hidden', events.join(' '));
    }

    var $toggleJoinPartInput = $controls.find('#toggle-join-part');
    var eventsKey = 'korobi-hidden-events';
    var statusEvents = ['join', 'quit', 'part'];
    var hiddenEvents = [];

    var $toggleLocalTimezoneInput = $controls.find('#toggle-timezone');
    var timezoneKey = 'korobi-use-local-timezone';
    var useLocalTimezone = true;
    var timezoneOffset = new Date().getTimezoneOffset();

    // Load local storage config
    var fromStorage;
    if(window.localStorage) {
        if(fromStorage = localStorage.getItem(eventsKey)) {
            try {
                hiddenEvents = JSON.parse(fromStorage);
                var joinPartHidden = statusEvents.every(function (e) {
                    return hiddenEvents.indexOf(e) !== -1;
                });
                $toggleJoinPartInput.prop('checked', !joinPartHidden);
                hideEvents(hiddenEvents);
            } catch (ex) {
                localStorage.removeItem(eventsKey);
            }
        }

        if(fromStorage = localStorage.getItem(timezoneKey)) {
            useLocalTimezone = fromStorage === '1' || fromStorage === undefined;
            if(useLocalTimezone) {
                $logs.find('.timestamp').each(function(index, time) {
                    var $time = $(time);
                    var timeParts = $time.text().split(':');
                    $time.text(dateToStringTimestamp(new Date(
                        0, 0, 0,
                        timeParts[0],
                        timeParts[1] - timezoneOffset,
                        timeParts[2]
                    )));
                });
            } else {
                $toggleLocalTimezoneInput.prop('checked', false);
            }
        }
    }

    // Status event toggle
    $toggleJoinPartInput.change(function() {
        var $this = $(this);
        if($this.prop('checked')) {
            hiddenEvents = hiddenEvents.filter(function(e) {
                return statusEvents.indexOf(e) === -1;
            });
        } else {
            hiddenEvents = hiddenEvents
                .concat(statusEvents)
                .filter(function(e, i, arr) {
                    return arr.indexOf(e) === i;
                });
        }
        if(window.localStorage) {
            localStorage.setItem(eventsKey, JSON.stringify(hiddenEvents));
        }
        hideEvents(hiddenEvents);
    });

    // Local timezone toggle
    $toggleLocalTimezoneInput.change(function() {
        useLocalTimezone = $(this).prop('checked');
        if(window.localStorage) {
            if(useLocalTimezone) {
                localStorage.setItem(timezoneKey, 1);
            } else {
                localStorage.setItem(timezoneKey, 0);
            }
        }
    });

    $logs.on('new_line', function(e, line) {
        if(useLocalTimezone) {
            line.time.setMinutes(line.time.getMinutes() + timezoneOffset);
        }
    });
});

@@ -1591,32 +1591,41 @@
 efined;%0A        
+%7D%0A    %7D%0A%0A
     if(useLocalT
@@ -1635,32 +1635,59 @@
 zone) %7B%0A        
+// Translate all timezones%0A
         $logs.fi
@@ -1728,32 +1728,24 @@
 ex, time) %7B%0A
-        
             
@@ -1773,32 +1773,24 @@
             
-        
 var timePart
@@ -1830,24 +1830,16 @@
         
- 
-       
 $time.te
@@ -1889,24 +1889,16 @@
         
-  
-      
 0, 0, 0,
@@ -1898,24 +1898,16 @@
 , 0, 0,%0A
-        
         
@@ -1940,32 +1940,24 @@
             
-   
-     
 timeParts%5B1%5D
@@ -1987,32 +1987,24 @@
             
-        
 timeParts%5B2%5D
@@ -2016,24 +2016,16 @@
         
-     
-   
 )));%0A   
@@ -2029,36 +2029,20 @@
         
-      
-  
 %7D);%0A
-        
     %7D el
@@ -2042,32 +2042,24 @@
    %7D else %7B%0A
-        
         $tog
@@ -2108,32 +2108,8 @@
 e);%0A
-            %7D%0A        %7D%0A
     
@@ -3172,32 +3172,33 @@
 e) %7B%0A        if(
+!
 useLocalTimezone

Add timezone toggle, second try