Sha256: 0912452227a44f55bb7c8762d59ef589d1fa6be4cad8aa594e0e5a73b326c231

Contents?: true

Size: 524 Bytes

Versions: 4

Compression:

Stored size: 524 Bytes

Contents

(function() {
  window.Time = {
    tz_offset: 60 * -(new Date()).getTimezoneOffset(),
    local_to_utc: function(timestamp) {
      return parseInt(timestamp, 10) - Time.tz_offset;
    },
    utc_to_local: function(timestamp) {
      return parseInt(timestamp, 10) + Time.tz_offset;
    },
    server_to_client: function(timestamp) {
      return this.utc_to_local(timestamp) * 1000;
    },
    client_to_server: function(timestamp) {
      return Math.floor(this.local_to_utc(timestamp / 1000));
    }
  };
}).call(this);

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rrd-grapher-1.0.3 lib/rrd-grapher/public/javascripts/classes/time.js
rrd-grapher-1.0.2 lib/rrd-grapher/public/javascripts/classes/time.js
rrd-grapher-1.0.1 lib/rrd-grapher/public/javascripts/classes/time.js
rrd-grapher-1.0.0 lib/rrd-grapher/public/javascripts/classes/time.js