<commit_before>$(document).ready(() => {
  'use strict';

  // strict mode
  // get, format, display date and time
  (function() {
    const formatDay = function(i) {
      const days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday',
        'Friday', 'Saturday'
      ];

      return days[i];
    };

    // turn off if user selects 24 hour time display
    const formatHour = function(hr) {
      return (hr > 12) ? hr - 12 : hr;
    };

    const formatMonth = function(j) {
      const months = ['Jan', 'Feb', 'March', 'April', 'May', 'June', 'July',
        'Aug', 'Sept', 'Oct', 'Nov', 'Dec'
      ];

      return months[j];
    };

    const formatTime = function(i) {
      return (i < 10) ? `0${i}` : i;
    };

    const getDate = function() {
      const today = new Date();
      const day = formatDay(today.getDay());
      const date = today.getDate();
      const month = formatMonth(today.getMonth());
      const year = today.getFullYear();

      $('#date').text(`${day} | ${month} ${date}, ${year}`);
    };

    const getTime = function() {
      const today = new Date();
      const hr = formatHour(today.getHours());
      const min = formatTime(today.getMinutes());

      $('#time').text(`${hr}:${min}`);
      setTimeout(() => {
        getTime();
        getDate();
      }, 500);
    };

    getDate();
    getTime();
  })();

  // get data from forecast.io
  (function() {
    const $forecastIO = $.getJSON('https://dailydash.herokuapp.com/40.055550,-105.208595');

    $forecastIO.done((data) => {
      if ($forecastIO.status !== 200) {
        return;
      }
      const weatherData = data;

      localStorage.setItem('forecastResponse', weatherData);

      $forecastIO.fail((err) => {
        return err;

        // console.log(err);
      });
    });
  })();

    // display current temp
    // need to adjust scope of data returned form forecast.io
  (function() {
    const currentTemp = Math.round(data.currently.apparentTemperature);

    $('#temp > h1').text(`${currentTemp}\u00B0`);
  })();
});<commit_msg>update app.js with function to display current temperature from data stored in local storage<commit_after>$(document).ready(() => {
  'use strict';

  // strict mode
  // get, format, display date and time
  (function() {
    const formatDay = function(i) {
      const days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday',
        'Friday', 'Saturday'
      ];

      return days[i];
    };

    // turn off if user selects 24 hour time display
    const formatHour = function(hr) {
      return (hr > 12) ? hr - 12 : hr;
    };

    const formatMonth = function(j) {
      const months = ['Jan', 'Feb', 'March', 'April', 'May', 'June', 'July',
        'Aug', 'Sept', 'Oct', 'Nov', 'Dec'
      ];

      return months[j];
    };

    const formatTime = function(i) {
      return (i < 10) ? `0${i}` : i;
    };

    const getDate = function() {
      const today = new Date();
      const day = formatDay(today.getDay());
      const date = today.getDate();
      const month = formatMonth(today.getMonth());
      const year = today.getFullYear();

      $('#date').text(`${day} | ${month} ${date}, ${year}`);
    };

    const getTime = function() {
      const today = new Date();
      const hr = formatHour(today.getHours());
      const min = formatTime(today.getMinutes());

      $('#time').text(`${hr}:${min}`);
      setTimeout(() => {
        getTime();
        getDate();
      }, 500);
    };

    getDate();
    getTime();
  })();

  // get data from forecast.io
  (function() {
    const $forecastIO = $.getJSON('https://dailydash.herokuapp.com/40.055550,-105.208595');

    $forecastIO.done((data) => {
      if ($forecastIO.status !== 200) {
        return;
      }

      const weatherData = JSON.stringify(data);

      localStorage.setItem('forecastResponse', weatherData);

      $forecastIO.fail((err) => {
        return err;

        // console.log(err);
      });
    });
  })();

    // display current temp
  (function() {
    const forecastResponse =
    JSON.parse(localStorage.getItem('forecastResponse'));

    const currentTemp =
    Math.round(forecastResponse.currently.apparentTemperature);

    $('#temp > h1').text(`${currentTemp}\u00B0`);
  })();
});
{'fraction_non_alphanumeric': 0.1852112676056338, 'fraction_numerical': 0.016901408450704224, 'mean_word_length': 2.4614134849715676, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6279026', 'n_tokens_mistral': 1435, 'n_tokens_neox': 1315, 'n_words': 315}