From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.

$(function() {

  var days = 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],

      months = 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],

      $oldPopover;

  $('head').append('<link href="https://en.wikieducator.org/skins/common/we/vendor/jQuery.popover/popover.css" rel="stylesheet" />');

  $.getScript("https://en.wikieducator.org/skins/common/we/vendor/jQuery.popover/jquery.popover-1.1.2.js", function() {

    $('.weLTime').click(function() {

      if ($oldPopover) {

        $oldPopover.popover('hide');

      }

      var t = $(this).attr('title');



      event.preventDefault();

      event.stopPropagation();



      $oldPopover = $(this);

      $(this).popover({

        trigger: 'none',

        title: 'Local time',

        content: t

      }).popover('show');

      return false;

    });

  });

  $('.weLTime').each(function() {

    function hour(d) {

      var a = 'AM',

          h = d.getHours();

      if (h >= 12) {

          h = h - 12;

          a = 'PM';

      }

      if (h === 0) {

          h = 12;

      }

      h = h.toString();

      return {h: h, a: a};

    }

    function minute(d) {

      var r = d.getMinutes().toString();

      if (r.length === 1) {

        r = '0' + r;

      }

      return r;

    }



    var t = $(this).attr('title'),

        d = new Date(t),

        h = hour(d),

        m = minute(d),

        ds = daysd.getDay()] + ', ' + monthsd.getMonth()] + ' ' + d.getDate() + ' ' + h.h + ':' + m + h.a + ' ' + d.toString().replace(/.*\(([^)]+)\)$/, '$1');

    console.log(t, '->', ds);

    $(this).attr('title', ds);

  });

})
From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.

$(function() {

  var days = 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],

      months = 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],

      $oldPopover;

  $('head').append('<link href="https://en.wikieducator.org/skins/common/we/vendor/jQuery.popover/popover.css" rel="stylesheet" />');

  $.getScript("https://en.wikieducator.org/skins/common/we/vendor/jQuery.popover/jquery.popover-1.1.2.js", function() {

    $('.weLTime').click(function() {

      if ($oldPopover) {

        $oldPopover.popover('hide');

      }

      var t = $(this).attr('title');



      event.preventDefault();

      event.stopPropagation();



      $oldPopover = $(this);

      $(this).popover({

        trigger: 'none',

        title: 'Local time',

        content: t

      }).popover('show');

      return false;

    });

  });

  $('.weLTime').each(function() {

    function hour(d) {

      var a = 'AM',

          h = d.getHours();

      if (h >= 12) {

          h = h - 12;

          a = 'PM';

      }

      if (h === 0) {

          h = 12;

      }

      h = h.toString();

      return {h: h, a: a};

    }

    function minute(d) {

      var r = d.getMinutes().toString();

      if (r.length === 1) {

        r = '0' + r;

      }

      return r;

    }



    var t = $(this).attr('title'),

        d = new Date(t),

        h = hour(d),

        m = minute(d),

        ds = daysd.getDay()] + ', ' + monthsd.getMonth()] + ' ' + d.getDate() + ' ' + h.h + ':' + m + h.a + ' ' + d.toString().replace(/.*\(([^)]+)\)$/, '$1');

    console.log(t, '->', ds);

    $(this).attr('title', ds);

  });

})

Videos

Youtube | Vimeo | Bing

Websites

Google | Yahoo | Bing

Encyclopedia

Google | Yahoo | Bing

Facebook