0

May I know how can I use JQuery UI Datepicker to get the range of the date between StartDate and EndDate?

Example:

Start date: 06-March-2014
End date: 09-March-2014

So, my table should able to display output like below.

  1. 06-March-2014
  2. 07-March-2014
  3. 08-March-2014
  4. 09-March-2014

Is that possible to do it? Or I should use method like this

var totalDay = endDate - startDate;

for(var i = 0; i < totalDay; i++) {
    /* Display table output */
}

If I want to use the method like this, how can I achieve it?

Thank you.

Blackie
  • 53
  • 1
  • 14
  • See the answer :) http://stackoverflow.com/questions/542938/how-do-i-get-the-number-of-days-between-two-dates-in-javascript – VinhNT Mar 06 '14 at 04:24
  • If u using the datepicker u can set mindate and max date then calender will show only that date range. – Neha Mar 06 '14 at 04:29
  • Thanks! I wonder why I cannot saw this question. :( – Blackie Mar 06 '14 at 04:29
  • @Neha, I need to get the range of the date in order to display the column. :( – Blackie Mar 06 '14 at 04:30
  • Are u looking something like this solution.. - http://jsfiddle.net/7DHVr/11/ – Neha Mar 06 '14 at 04:40
  • @Neha, Nope. It is something to let users choose start date and end date. And the system will display the table column based on the range of the date. You get what I mean? >_< Sorry my English quite weak. – Blackie Mar 06 '14 at 04:49
  • ok! so user will choose dates from datepicker (so u have 2 date picker? start and end) and u will display the range on some div like above date text...?? – Neha Mar 06 '14 at 05:21
  • @Neha, yeah, you are absolutely right. XD Sorry for the late reply. – Blackie Mar 06 '14 at 05:57
  • Sorry took me bit time(was busy) here is the thing u looking - http://jsfiddle.net/7DHVr/15/ – Neha Mar 06 '14 at 07:41
  • @Blackie did u look the fiddle, does it help? – Neha Mar 06 '14 at 09:14
  • @Neha, Yes, I saw it. But it is not I want. – Blackie Mar 06 '14 at 10:58

0 Answers0