Sha256: 1d99b38615ac323acddffb85727b45b022dae65b9531f086bbeb4f5cf5922216

Contents?: true

Size: 1.08 KB

Versions: 22

Compression:

Stored size: 1.08 KB

Contents

//= require social_stream/callback
//= require social_stream/events.poster

SocialStream.Event = (function(SS, $, undefined) {
  var callback = new SS.Callback();

  var color = function(){
    return SS.Events.current.eventColor;
  };

  var fixDates = function(){
    $(".event").each(function(){
      dateString = $(this).find("time").attr("datetime");

      date = new Date(dateString);

      var dayEl = $(this).find(".event .day");
      if (dayEl.length) {
        dayEl.text($.datepicker.formatDate('d', date));
      }

      var monthEl = $(this).find(".event .month");
      if (monthEl.length) {
        monthEl.text($.datepicker.formatDate('M', date));
      }

      var hourEl = $(this).find(".event .hour");
      if(hourEl.length) {
        var minutes = date.getMinutes();
        if (minutes<10) minutes = "0" + minutes;
        hourEl.text(date.getHours() + ':' + minutes);
      }
    });
  };

  callback.register('index',
                    fixDates,
                    SocialStream.Events.Poster.show);

  return callback.extend({
    color: color,
  });

})(SocialStream, jQuery);

Version data entries

22 entries across 22 versions & 2 rubygems

Version Path
social_stream-2.2.2 events/app/assets/javascripts/social_stream/event.js
social_stream-events-2.2.1 app/assets/javascripts/social_stream/event.js
social_stream-2.2.1 events/app/assets/javascripts/social_stream/event.js
social_stream-2.2.0 events/app/assets/javascripts/social_stream/event.js
social_stream-events-2.2.0 app/assets/javascripts/social_stream/event.js
social_stream-2.1.1 events/app/assets/javascripts/social_stream/event.js
social_stream-2.1.0 events/app/assets/javascripts/social_stream/event.js
social_stream-events-2.1.0 app/assets/javascripts/social_stream/event.js
social_stream-2.0.4 events/app/assets/javascripts/social_stream/event.js
social_stream-events-2.0.2 app/assets/javascripts/social_stream/event.js
social_stream-2.0.3 events/app/assets/javascripts/social_stream/event.js
social_stream-2.0.2 events/app/assets/javascripts/social_stream/event.js
social_stream-events-2.0.1 app/assets/javascripts/social_stream/event.js
social_stream-2.0.1 events/app/assets/javascripts/social_stream/event.js
social_stream-2.0.0 events/app/assets/javascripts/social_stream/event.js
social_stream-events-2.0.0 app/assets/javascripts/social_stream/event.js
social_stream-2.0.0.beta3 events/app/assets/javascripts/social_stream/event.js
social_stream-events-2.0.0.beta3 app/assets/javascripts/social_stream/event.js
social_stream-2.0.0.beta2 events/app/assets/javascripts/social_stream/event.js
social_stream-events-2.0.0.beta2 app/assets/javascripts/social_stream/event.js