mattlewis92 / angular-bootstrap-calendar

A port of the bootstrap calendar widget to AngularJS (no jQuery required!)
https://mattlewis92.github.io/angular-bootstrap-calendar/
MIT License
798 stars 369 forks source link

event resizing #603

Closed yasserht closed 7 years ago

yasserht commented 7 years ago

Hello, how can I change the start and end time of an event in api as well , when I resize it or drag it ?

burtek commented 7 years ago

I would use $scope.$watch to watch for changes in vm.events and then fire POST request to API

yasserht commented 7 years ago

is it going to e the same function ? can you give me an example ?

burtek commented 7 years ago

Actually, there is much better idea shown here - using <mwl-calendar ... on-event-times-changed="..."> parameter (check out this plunker). You can use same approach and then fire API request inside vm.eventTimesChanged function.

yasserht commented 7 years ago

yes I already tried it, but since Im using drag and drop, i couldn't use both, as in this plunker http://plnkr.co/edit/7hgrMmaSufYjWGeAE6Lu?p=preview

burtek commented 7 years ago

You could have said that in the first place. You can use same function as for drag-and-drop, it'd be enough to check if the event passed to the function is external or not (you can for example add external: true fields to the external events and then remove them as soon you drop them onto the calendar.

yasserht commented 7 years ago

But this solves only dragging and dropping not resizing or moving an event inside the calendar