Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. $(document).ready(function() {
  2. // ... All the calendar functionality
  3.  
  4. $('#appointment_update').click(function(e) {
  5. e.preventDefault();
  6. var data = {
  7. _token: '{{ csrf_token() }}',
  8. appointment_id: $('#appointment_id').val(),
  9. start_time: $('#start_time').val(),
  10. finish_time: $('#finish_time').val(),
  11. };
  12.  
  13. $.post('{{ route('admin.appointments.ajax_update') }}', data, function( result ) {
  14. $('#calendar').fullCalendar('removeEvents', $('#event_id').val());
  15.  
  16. $('#calendar').fullCalendar('renderEvent', {
  17. title: result.appointment.client.first_name + ' ' + result.appointment.client.last_name,
  18. start: result.appointment.start_time,
  19. end: result.appointment.finish_time
  20. }, true);
  21.  
  22. $('#editModal').modal('hide');
  23. });
  24. });
  25. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement