Skip to content
This repository has been archived by the owner. It is now read-only.

on-event-times-changed and on-date-range-select conflict #439

Closed
kprovorov opened this Issue Aug 31, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@kprovorov
Copy link

kprovorov commented Aug 31, 2016

I try to make a calendar where i can create new events by select range and edit events time by drag and drop. Here is my calendar html:

<mwl-calendar
          events="vm.events"
          view="vm.calendarView"
          day-view-split="15"
          view-date="vm.viewDate"
          on-date-range-select="vm.rangeSelected(calendarRangeStartDate, calendarRangeEndDate)"
          on-event-times-changed="vm.eventTimesChanged(calendarEvent, calendarNewEventStart, calendarNewEventEnd); calendarEvent.startsAt = calendarNewEventStart; calendarEvent.endsAt = calendarNewEventEnd"
          day-view-start="9:00"
          day-view-end="21:59">
</mwl-calendar>

and here is my vm.eventTimesChanged function:

vm.eventTimesChanged = function(event) {
      console.log(event);
    };

and here is my vm.rangeSelected function:

vm.rangeSelected = function(startDate, endDate) {
      vm.events.push({
        title: 'New',
        color: calendarConfig.colorTypes.warning,
        startsAt: startDate,
        endsAt: endDate,
        draggable: true,
        resizable: true
      })
    };

so when i try to drag&drop my event a have error message in my console:
2016-08-31 17 37 54

full code is here: https://github.com/kprovorov/angular-calendar

@mattlewis92

This comment has been minimized.

Copy link
Owner

mattlewis92 commented Sep 1, 2016

Thanks for the detailed bug report, I'll get that fixed up in the next version! (although I think the JS error is harmless and you can just ignore it)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.