angular-simple-calendar icon indicating copy to clipboard operation
angular-simple-calendar copied to clipboard

Multiple events a day instead of just one.

Open tuananh opened this issue 10 years ago • 3 comments

I think it's more realistic instead of just one event a day.

in template

'ng-class="{default: isDefaultDate(date), event: date.event && date.event.length > 0, disabled: date.disabled || !date}"' +

bindEvent = function (date) {
  if (!date || !$scope.events) { return; }
  date.event=[];
  $scope.events.forEach(function(event) {
    event.date = new Date(event.date);
    if (date.year === event.date.getFullYear() && date.month === event.date.getMonth() && date.day === event.date.getDate()) {
      // date.event = event;
      date.event.push(event);
    }
  });
};

tuananh avatar Jan 14 '15 05:01 tuananh

@tuananh This directive was designed for simple usage with only one event per specific date. We will appreciate a good pull request though.

ilyagelman avatar Jan 18 '15 13:01 ilyagelman

Hi,

Remeber change this portion the code in the directive

this

< div class="calendar-title">{{date.event.title}}< /div >

for this one

< div ng-repeat="eventos in date.event track by $index">{{eventos.title}}< /div >

you need put ng-repeat thank's a lot

armandoruizgonzalez avatar Dec 30 '15 20:12 armandoruizgonzalez

Was this idea ever submitter as a pull request? I tried adding multiple events per day and it doesn't seem to work.

mikemil avatar Aug 27 '16 02:08 mikemil