anchor.diff:  <%# E1860 : Auto Populate the Dates when the instructor enters the first submission date of the topic %>
   <%# This is done based on the difference in dates of the first topic in that staggered Assignment %>
   <script type="text/javascript">
  -    $('.datetimepicker').datetimepicker({
  +$('.datetimepicker').datetimepicker({
       dateFormat: 'yy/mm/dd',
       timeFormat: 'HH:mm:ss'
   });
   
  -function populateDates(topic_id, review_rounds) {
  +function populateDueDates(topic_id, review_rounds) {
       elementsArray = [];
       $('[id^="due_date_<%= @assignment.sign_up_topics[0].id %>"]').each( function(i, e) {
           /* you can use e.id instead of $(e).attr('id') */
  
positive.code:       <% for review_round in 1..review_rounds %>
          <% topic_id = @assignment.sign_up_topics[i].id %>
          <%# Add the javascript trigger for onfocusout only for the first input field in the table, this way we do not intentinally trigger it when changing the other dates %>
          <td><%= text_field :due_date, (topic_id.to_s + '_submission_' + review_round.to_s + '_due_date').to_s, size: 20, value: check_topic_due_date_value(assignment_submission_due_dates, topic_id, 1, review_round), class: 'datetimepicker', onfocusout: review_round == 1 ? "javascript:populateDates(#{topic_id}, #{review_rounds})" : nil %></td>
          <td><%= text_field :due_date, (topic_id.to_s + '_review_' + review_round.to_s + '_due_date').to_s, size: 20, value: check_topic_due_date_value(assignment_review_due_dates, topic_id, 2, review_round), class: 'datetimepicker' %></td>
        <%end%>
      </tr>
  
negative.code:     // Date for the first Submission of the topic.
      var initialDate = jQuery("#" + ids[0]).val();
      for (i = 1; i < ids.length; i++) {
          // Do not update the value if offset is 0
          if (offsetArray[i-1] != 0) {
              // Add Days to the starting date
              var d = addDays(new Date(initialDate), offsetArray[i-1]);
              // "00" + d.getHours() -> slice(-2) returns date and time in the format 08 instead of 8 when the date or time is in single digit
              var formattedDate = d.getFullYear() + "-"  + 
                                  ("00" + (d.getMonth() + 1)).slice(-2) + "-" + 
                                  ("00" + d.getDate()).slice(-2) + " " + 
                                  ("00" + d.getHours()).slice(-2) + ":" + 
                                  ("00" + d.getMinutes()).slice(-2) + ":" + 
                                  ("00" + d.getSeconds()).slice(-2)
              // Only Change the value of the field if it is empty, Do not change in case there is a date present there already
              if (jQuery("#" + ids[i]).val() == "") {
                  jQuery("#" + ids[i]).val(formattedDate);
              }
          }
      }
  }
  