title: custom update table
body: <p>I have the following table:</p>
  
  <pre><code>code item   price   start date   end date 
  --------------------------------------------------
  art1         2.47    01/01/2015   31/03/2015
  art1         1.23    01/04/2015   21/09/2015 
  art1         3.55    22/09/2015   01/01/2018 
  </code></pre>
  
  <p>When I will add a new line which start date exists already between a start date and end date in the table .</p>
  
  <ol>
  <li>I need to update the end date in the table with the <code>start date -1</code> of the new line to be added </li>
  <li>add the new line .</li>
  </ol>
  
  <p>For example, I have a new line to added:</p>
  
  <pre><code>code item   price   start date   end date 
  -----------------------------------------
  art1         4      28/12/2015   31/05/2018
  </code></pre>
  
  <p>What I expect as a final result is the following table :</p>
  
  <pre><code>code item   price   start date   end date 
  --------------------------------------------------
  art1         2.47    01/01/2015   31/03/2015
  art1         1.23    01/04/2015   21/09/2015 
  art1         3.55    22/09/2015   27/12/2015 
  art1           4      28/12/2015  31/05/2018
  </code></pre>