title: Get all dates between two dates retrieved from a string and make a string
body: <p>I have a string like the following:</p>
  
  <pre><code>#CI[20131229]CO[20131231]PV1,#CI[20130918]CO[20130919]PV3,#CI[20131009]CO[20131011]PV3,#CI[20131226]CO[20140103]PV4,#CI[20131226]CO[20140103]PV3
  </code></pre>
  
  <p>.... list goes on with same format. Format is:</p>
  
  <pre><code>,# = entry seperator
  CI[YYYYMMDD] = Check In Date
  CO[YYYYMMDD] = Check Out Date
  PVx = Room Number
  </code></pre>
  
  <p>I want to get all dates within the check in and checkout EXCEPT the checkin checkout date and put to string like this (if it was the above string):</p>
  
  <pre><code>#20131230PV1,#20131010PV3,#20131227PV3,#20131228PV3,#20131229PV3,#20131230PV3,#20131231PV3,#20140101PV3,#20140102PV3
  </code></pre>
  
  <p>I needed to retrieve CheckIn dates and Checkout dates seperately
  That I managed to did successfully with this:</p>
  
  <pre><code>bookcaldatesci.innerHTML = bookcaldates.innerHTML.replace(/CO[^\]]+\]/ig, "");
  bookcaldatesci.innerHTML = bookcaldatesci.innerHTML.replace(/CI\[/ig, "");
  bookcaldatesci.innerHTML = bookcaldatesci.innerHTML.replace(/\]/ig, "");
  bookcaldatesco.innerHTML = bookcaldates.innerHTML.replace(/CI[^\]]+\]/g, "");
  bookcaldatesco.innerHTML = bookcaldatesco.innerHTML.replace(/CO\[/ig, "");
  bookcaldatesco.innerHTML = bookcaldatesco.innerHTML.replace(/\]/ig, "");
  jQuery.noConflict();
  $(bookcaldatesci.innerHTML).css({'background-image':'url("img/booked.jpg")','background-repeat':'no-repeat','background-position-y':'100%','background-size':'100% 50%'});
  $(bookcaldatesco.innerHTML).css({'background-image':'url("img/booked.jpg")','background-repeat':'no-repeat','background-size':'100% 50%'});
  </code></pre>
  
  <p>But to add up dates between the date range I'm a bit lost..</p>
  
  <p>(I GOT THE ANSWER: TO CHECK, CHECK MY ANSWER BELOW)</p>