what I am trying to do is to compare the current date and the date on the Wicker in order to choose the right date...
I have this code placed on - (void)webViewDidFinishLoad:(UIWebView *)webView
after going to the sutiable webpage, however its not working. I have tried to compile this code in the web , and no errors has been prompt. can any one tell me whats going on here?
[self.webView stringByEvaluatingJavaScriptFromString: @"var opt1ons = document.getElementById('viewns_7_58O1047GQVV950ILCQ3QA720N2_:_id0:weekFrom').options; \
var opt2ons = document.getElementById('viewns_7_58O1047GQVV950ILCQ3QA720N2_:_id0:weekTo').options; \
var i; \
for( i = 0;i > opt1ons.length;i++){ var currdate = new Date(); currdate = currdate.setHours(0,0,0,0);var selectdate1 = new Date(opt1ons[i].value); \
selectdate1 = selectdate1.setHours(0,0,0,0);var selectdate2 = new Date(opt2ons[i].value); \
selectdate2 = selectdate2.setHours(0,0,0,0); \
if (selectdate1 <= currdate && currdate <= selectdate2)\
{document.getElementById('viewns_7_58O1047GQVV950ILCQ3QA720N2_:_id0:weekFrom').selectedIndex = i; \
document.getElementById('viewns_7_58O1047GQVV950ILCQ3QA720N2_:_id0:weekTo') .selectedIndex = i ; \
document.getElementById('viewns_7_58O1047GQVV950ILCQ3QA720N2_:_id0:search') .click();} \
}"];
code of the picker from the web:
<select id="viewns_7_58O1047GQVV950ILCQ3QA720N2_:_id0:weekFrom" name="viewns_7_58O1047GQVV950ILCQ3QA720N2_:_id0:weekFrom" class="hkvtcsp_textInput" size="1"> <option value="02-Sep-2013">(1) 02-Sep-2013 - 07-Sep-2013</option>
<option value="09-Sep-2013">(2) 09-Sep-2013 - 14-Sep-2013</option>
<option value="16-Sep-2013">(3) 16-Sep-2013 - 21-Sep-2013</option>
<option value="23-Sep-2013">(4) 23-Sep-2013 - 28-Sep-2013</option>
<option value="30-Sep-2013">(5) 30-Sep-2013 - 05-Oct-2013</option>
<option value="07-Oct-2013">(6) 07-Oct-2013 - 12-Oct-2013</option>
<option value="14-Oct-2013">(7) 14-Oct-2013 - 19-Oct-2013</option>
<option value="21-Oct-2013">(8) 21-Oct-2013 - 26-Oct-2013</option>
<option value="28-Oct-2013">(9) 28-Oct-2013 - 02-Nov-2013</option>
<option value="04-Nov-2013">(10) 04-Nov-2013 - 09-Nov-2013</option>
<option value="11-Nov-2013">(11) 11-Nov-2013 - 16-Nov-2013</option>
<option value="18-Nov-2013">(12) 18-Nov-2013 - 23-Nov-2013</option>
<option value="25-Nov-2013">(13) 25-Nov-2013 - 30-Nov-2013</option>
<option value="02-Dec-2013">(14) 02-Dec-2013 - 07-Dec-2013</option>
<option value="09-Dec-2013">(15) 09-Dec-2013 - 14-Dec-2013</option>
<option value="16-Dec-2013">(16) 16-Dec-2013 - 21-Dec-2013</option>
<option value="23-Dec-2013">(17) 23-Dec-2013 - 28-Dec-2013</option>
<option value="30-Dec-2013">(18) 30-Dec-2013 - 04-Jan-2014</option>
<option value="06-Jan-2014">(19) 06-Jan-2014 - 11-Jan-2014</option>
<option value="13-Jan-2014">(20) 13-Jan-2014 - 18-Jan-2014</option>
<option value="20-Jan-2014">(21) 20-Jan-2014 - 25-Jan-2014</option>
<option value="27-Jan-2014">(22) 27-Jan-2014 - 01-Feb-2014</option>
<option value="03-Feb-2014">(23) 03-Feb-2014 - 08-Feb-2014</option>
<option value="10-Feb-2014">(24) 10-Feb-2014 - 15-Feb-2014</option>
<option value="17-Feb-2014">(25) 17-Feb-2014 - 22-Feb-2014</option>
<option value="24-Feb-2014">(26) 24-Feb-2014 - 01-Mar-2014</option>
<option value="03-Mar-2014">(27) 03-Mar-2014 - 08-Mar-2014</option>
<option value="10-Mar-2014">(28) 10-Mar-2014 - 15-Mar-2014</option>
<option value="17-Mar-2014">(29) 17-Mar-2014 - 22-Mar-2014</option>
<option value="24-Mar-2014">(30) 24-Mar-2014 - 29-Mar-2014</option>
<option value="31-Mar-2014">(31) 31-Mar-2014 - 05-Apr-2014</option>
<option value="07-Apr-2014">(32) 07-Apr-2014 - 12-Apr-2014</option>
<option value="14-Apr-2014">(33) 14-Apr-2014 - 19-Apr-2014</option>
<option value="21-Apr-2014">(34) 21-Apr-2014 - 26-Apr-2014</option>
<option value="28-Apr-2014">(35) 28-Apr-2014 - 03-May-2014</option>
<option value="05-May-2014">(36) 05-May-2014 - 10-May-2014</option>
<option value="12-May-2014">(37) 12-May-2014 - 17-May-2014</option>
<option value="19-May-2014">(38) 19-May-2014 - 24-May-2014</option>
<option value="26-May-2014">(39) 26-May-2014 - 31-May-2014</option>
<option value="02-Jun-2014">(40) 02-Jun-2014 - 07-Jun-2014</option>
<option value="09-Jun-2014">(41) 09-Jun-2014 - 14-Jun-2014</option>
<option value="16-Jun-2014">(42) 16-Jun-2014 - 21-Jun-2014</option>
<option value="23-Jun-2014">(43) 23-Jun-2014 - 28-Jun-2014</option>
<option value="30-Jun-2014">(44) 30-Jun-2014 - 05-Jul-2014</option>
<option value="07-Jul-2014">(45) 07-Jul-2014 - 12-Jul-2014</option>
<option value="14-Jul-2014">(46) 14-Jul-2014 - 19-Jul-2014</option>
<option value="21-Jul-2014">(47) 21-Jul-2014 - 26-Jul-2014</option>
<option value="28-Jul-2014">(48) 28-Jul-2014 - 02-Aug-2014</option>
<option value="04-Aug-2014">(49) 04-Aug-2014 - 09-Aug-2014</option>
<option value="11-Aug-2014">(50) 11-Aug-2014 - 16-Aug-2014</option>
<option value="18-Aug-2014">(51) 18-Aug-2014 - 23-Aug-2014</option>
<option value="25-Aug-2014">(52) 25-Aug-2014 - 30-Aug-2014</option>
and the code of the second picker
<select id="viewns_7_58O1047GQVV950ILCQ3QA720N2_:_id0:weekTo" name="viewns_7_58O1047GQVV950ILCQ3QA720N2_:_id0:weekTo" class="hkvtcsp_textInput" size="1"> <option value="07-Sep-2013">(1) 02-Sep-2013 - 07-Sep-2013</option>
<option value="14-Sep-2013">(2) 09-Sep-2013 - 14-Sep-2013</option>
<option value="21-Sep-2013">(3) 16-Sep-2013 - 21-Sep-2013</option>
<option value="28-Sep-2013">(4) 23-Sep-2013 - 28-Sep-2013</option>
<option value="05-Oct-2013">(5) 30-Sep-2013 - 05-Oct-2013</option>
<option value="12-Oct-2013">(6) 07-Oct-2013 - 12-Oct-2013</option>
<option value="19-Oct-2013">(7) 14-Oct-2013 - 19-Oct-2013</option>
<option value="26-Oct-2013">(8) 21-Oct-2013 - 26-Oct-2013</option>
<option value="02-Nov-2013">(9) 28-Oct-2013 - 02-Nov-2013</option>
<option value="09-Nov-2013">(10) 04-Nov-2013 - 09-Nov-2013</option>
<option value="16-Nov-2013">(11) 11-Nov-2013 - 16-Nov-2013</option>
<option value="23-Nov-2013">(12) 18-Nov-2013 - 23-Nov-2013</option>
<option value="30-Nov-2013">(13) 25-Nov-2013 - 30-Nov-2013</option>
<option value="07-Dec-2013">(14) 02-Dec-2013 - 07-Dec-2013</option>
<option value="14-Dec-2013">(15) 09-Dec-2013 - 14-Dec-2013</option>
<option value="21-Dec-2013">(16) 16-Dec-2013 - 21-Dec-2013</option>
<option value="28-Dec-2013">(17) 23-Dec-2013 - 28-Dec-2013</option>
<option value="04-Jan-2014">(18) 30-Dec-2013 - 04-Jan-2014</option>
<option value="11-Jan-2014">(19) 06-Jan-2014 - 11-Jan-2014</option>
<option value="18-Jan-2014">(20) 13-Jan-2014 - 18-Jan-2014</option>
<option value="25-Jan-2014">(21) 20-Jan-2014 - 25-Jan-2014</option>
<option value="01-Feb-2014">(22) 27-Jan-2014 - 01-Feb-2014</option>
<option value="08-Feb-2014">(23) 03-Feb-2014 - 08-Feb-2014</option>
<option value="15-Feb-2014">(24) 10-Feb-2014 - 15-Feb-2014</option>
<option value="22-Feb-2014">(25) 17-Feb-2014 - 22-Feb-2014</option>
<option value="01-Mar-2014">(26) 24-Feb-2014 - 01-Mar-2014</option>
<option value="08-Mar-2014">(27) 03-Mar-2014 - 08-Mar-2014</option>
<option value="15-Mar-2014">(28) 10-Mar-2014 - 15-Mar-2014</option>
<option value="22-Mar-2014">(29) 17-Mar-2014 - 22-Mar-2014</option>
<option value="29-Mar-2014">(30) 24-Mar-2014 - 29-Mar-2014</option>
<option value="05-Apr-2014">(31) 31-Mar-2014 - 05-Apr-2014</option>
<option value="12-Apr-2014">(32) 07-Apr-2014 - 12-Apr-2014</option>
<option value="19-Apr-2014">(33) 14-Apr-2014 - 19-Apr-2014</option>
<option value="26-Apr-2014">(34) 21-Apr-2014 - 26-Apr-2014</option>
<option value="03-May-2014">(35) 28-Apr-2014 - 03-May-2014</option>
<option value="10-May-2014">(36) 05-May-2014 - 10-May-2014</option>
<option value="17-May-2014">(37) 12-May-2014 - 17-May-2014</option>
<option value="24-May-2014">(38) 19-May-2014 - 24-May-2014</option>
<option value="31-May-2014">(39) 26-May-2014 - 31-May-2014</option>
<option value="07-Jun-2014">(40) 02-Jun-2014 - 07-Jun-2014</option>
<option value="14-Jun-2014">(41) 09-Jun-2014 - 14-Jun-2014</option>
<option value="21-Jun-2014">(42) 16-Jun-2014 - 21-Jun-2014</option>
<option value="28-Jun-2014">(43) 23-Jun-2014 - 28-Jun-2014</option>
<option value="05-Jul-2014">(44) 30-Jun-2014 - 05-Jul-2014</option>
<option value="12-Jul-2014">(45) 07-Jul-2014 - 12-Jul-2014</option>
<option value="19-Jul-2014">(46) 14-Jul-2014 - 19-Jul-2014</option>
<option value="26-Jul-2014">(47) 21-Jul-2014 - 26-Jul-2014</option>
<option value="02-Aug-2014">(48) 28-Jul-2014 - 02-Aug-2014</option>
<option value="09-Aug-2014">(49) 04-Aug-2014 - 09-Aug-2014</option>
<option value="16-Aug-2014">(50) 11-Aug-2014 - 16-Aug-2014</option>
<option value="23-Aug-2014">(51) 18-Aug-2014 - 23-Aug-2014</option>
<option value="30-Aug-2014">(52) 25-Aug-2014 - 30-Aug-2014</option>