Помогите,уважаемые! Есть скрипт вывода калькулятора...Скрипт в Хроме работает отлично,в Опере выдает NaN.
ЯС-часть:
<script type="text/javascript">
function calculateDate(date1, date2){
diffc = date1.getTime() - date2.getTime();
days = Math.round(Math.abs(diffc/(1000*60*60*24)));
return days;
}
function rsfp_onSelectDate(date, type, args, calendar){
argsstr = String(args);
spldate = argsstr.split(",");
date1 = new Date(spldate[0],spldate[1]-1,spldate[2]);
date2 = '';
if(calendar.myid == 'cal5_0' && RSFormProCalendars[5]['calendar2'].getSelectedDates() != '')
date2 = new Date(RSFormProCalendars[5]['calendar2'].getSelectedDates());
if(calendar.myid == 'cal5_1' && RSFormProCalendars[5]['calendar1'].getSelectedDates() != '')
date2 = new Date(RSFormProCalendars[5]['calendar1'].getSelectedDates());
if(date2 != ''){
days = calculateDate(date1, date2);
document.getElementById('time').value = days;
}
return true;
}
</script>
HTML-часть:
<div class="componentheading"><h2>{global:formtitle}</h2></div>
{error}
<table class="formTableLayout" border="0">
<tr class="rsform-block rsform-block-nedvizhimost">
<td>{nedvizhimost:caption}</td>
<td>{nedvizhimost:body}<div class="formClr"></div>{nedvizhimost:validation}</td>
<td>{nedvizhimost:description}</td>
</tr>
<tr class="rsform-block rsform-block-price">
<td>{price:caption}</td>
<td>{price:body}<div class="formClr"></div>{price:validation}</td>
<td>{price:description}</td>
</tr>
<tr class="rsform-block rsform-block-price1">
<td>{price1:caption}</td>
<td>{price1:body}<div class="formClr"></div>{price1:validation}</td>
<td>{price1:description}</td>
</tr>
<tr class="rsform-block rsform-block-calendar1">
<td>{calendar1:caption} (*)</td>
<td>{calendar1:body}<div class="formClr"></div>{calendar1:validation}</td>
<td>{calendar1:description}</td>
</tr>
<tr class="rsform-block rsform-block-calendar2">
<td>{calendar2:caption} (*)</td>
<td>{calendar2:body}<div class="formClr"></div>{calendar2:validation}</td>
<td>{calendar2:description}</td>
</tr>
<tr class="rsform-block rsform-block-time">
<td>{time:caption} (*)</td>
<td>{time:body}<div class="formClr"></div>{time:validation}</td>
<td>{time:description}</td>
</tr>
<tr class="rsform-block rsform-block-services">
<td>{services:caption} (*)</td>
<td>{services:body}<div class="formClr"></div>{services:validation}</td>
<td>{services:description}</td>
</tr>
<tr class="rsform-block rsform-block-total">
<td>{total:caption}</td>
<td>{total:body}<div class="formClr"></div>{total:validation}</td>
<td>{total:description}</td>
</tr>
<tr class="rsform-block rsform-block-total1">
<td>{total1:caption}</td>
<td>{total1:body}<div class="formClr"></div>{total1:validation}</td>
<td>{total1:description}</td>
</tr>
</table>
Что делать,где копать?