<div class="row">
  <div class="small-12 medium-4 medium-offset-4 columns">
    <div id="app"></div>
  </div>
</div>
<script type="text/javascript">
  if (NoFrillsSleepTracker.isLocalStorageSupported()) {
    var userId = document.location.pathname.substring(4);
    var params = document.location.search.
                  substring(1).
                  split("&").
                  map(function(pair) { return pair.split("=") });
    for(var i = 0; i < params.length; i++) {
      var param = params[i];
      if (params[0] === "timezone") NoFrillsSleepTracker.setTimezone(window.localStorage, param[1]);
    }

    if (<%= @wakeup %>) {
      // Reset state when the server tells us to do so
      // Since we don't do 2 phase commit, or use an Ajax request to change the server's state,
      // we have to wait until the server acknowledges the state change before resetting our
      // localStorage state.
      NoFrillsSleepTracker.wakeUp(window.localStorage);
    }

    NoFrillsSleepTracker.renderApp(document.getElementById("app"), window.localStorage, userId, <%= @last5.to_json %>);
  } else {
    NoFrillsSleepTracker.renderLocalStorageDisabled(document.getElementById("app"));
  }
</script>

<div class="row">
  <div class="small-12 medium-4 medium-offset-4 columns">
    <div id="app"></div>
  </div>
</div>
<script type="text/javascript">
  if (NoFrillsSleepTracker.isLocalStorageSupported()) {
    var userId = document.location.pathname.substring(4);
    var params = document.location.search.
                  substring(1).
                  split("&").
                  map(function(pair) { return pair.split("=") });
    for(var i = 0; i < params.length; i++) {
      var param = params[i];
      if (param[0] === "timezone") NoFrillsSleepTracker.setTimezone(window.localStorage, param[1]);
    }

    if (<%= @wakeup %>) {
      // Reset state when the server tells us to do so
      // Since we don't do 2 phase commit, or use an Ajax request to change the server's state,
      // we have to wait until the server acknowledges the state change before resetting our
      // localStorage state.
      NoFrillsSleepTracker.wakeUp(window.localStorage);
    }

    NoFrillsSleepTracker.renderApp(document.getElementById("app"), window.localStorage, userId, <%= @last5.to_json %>);
  } else {
    NoFrillsSleepTracker.renderLocalStorageDisabled(document.getElementById("app"));
  }
</script>

Fix timezone was never stored in localStorage
Fix timezone was never stored in localStorage
