Uploaded image for project: 'PUBLIC - Liferay Alloy UI'
  1. PUBLIC - Liferay Alloy UI
  2. AUI-3158

Alloy-ui scheduler day and week views dragging event gives wrong startDate,endDate

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.0.0
    • Fix Version/s: None
    • Component/s: Scheduler
    • Labels:
      None
    • Environment:
      Alloy-UI Scheduler

      Description

      On dragging scheduler event in week view mode gives wrong start date and end date.

      function afterEventMoved(event, scheduler) {
                  var startDate;
                  var endDate;
                  var Content;
                  var Id;
                  // Obtain the new start and end dates in the month view.
                  if (event.currentTarget.originalDragNode) {
                      var eventNodeId = event.currentTarget.originalDragNode.get('id');
                      var eventsArray = scheduler.getEvents();
                      var movedEvent = null;
                      for (var i = 0; i < eventsArray.length; i++) {

                          if (eventNodeId === eventsArray[i].get('node').get('id')[0]) {
                              movedEvent = eventsArray[i];
                              break;
                          }
                      }

                      startDate = movedEvent.get('startDate').format('yyyy-MM-dd HH:mm:ss');
                      endDate = movedEvent.get('endDate').format('yyyy-MM-dd HH:mm:ss');
                      Id = movedEvent.get('id');
                      Content = movedEvent.get('content');

                  }

                  // Obtain the new start and end dates in the day and week views.
                  // Unfortunately, there seems to be a bug and the time of these dates
                  // seems to be incorrect (it seems to be the time before the event was dragged).
                  // The day, month, and year seem to be correct though.
                  else {   
                      startDate = event.currentTarget.draggingEventStartDate.format('yyyy-MM-dd HH:mm:ss');
                      endDate = event.currentTarget.draggingEventEndDate.format('yyyy-MM-dd HH:mm:ss');
                  }                  
              }

      below line gives wrong date


      event.currentTarget.draggingEventStartDate

      event.currentTarget.draggingEventEndDate

      in below screen-shot  schedule is from 6pm to 7pm after dragging schedule to 9pm it still gives end time 19 pm (i.e 7pm)

        Attachments

        1. Untitled.png
          Untitled.png
          215 kB
        2. Untitled-1.png
          Untitled-1.png
          161 kB

          Activity

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Days since last comment:
                1 year, 33 weeks, 2 days ago

                Packages

                Version Package