* fix the error of computeDays() for project.
This commit is contained in:
@@ -37,14 +37,25 @@ function computeDaysDelta(date1, date2)
|
||||
return (date2 - date1) / (1000 * 60 * 60 * 24)
|
||||
}
|
||||
|
||||
/**
|
||||
* Compute work days.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function computeWorkDays()
|
||||
{
|
||||
beginDate = $('#begin').val();
|
||||
endDate = $('#end').val();
|
||||
if(beginDate && endDate) $('#days').val(computeDaysDelta(beginDate, endDate));
|
||||
}
|
||||
|
||||
/* Auto compute the work days. */
|
||||
$(function()
|
||||
{
|
||||
$(".date").bind('dateSelected', function()
|
||||
{
|
||||
beginDate = $('#begin').val();
|
||||
endDate = $('#end').val();
|
||||
if(beginDate && endDate) $('#days').val(computeDaysDelta(beginDate, endDate));
|
||||
computeWorkDays();
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
@@ -44,11 +44,11 @@ $(document).ready(function()
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->project->begin;?></th>
|
||||
<td><?php echo html::input('begin', '', "class='text-3 date' onchange='computeDays()'");?></td>
|
||||
<td><?php echo html::input('begin', '', "class='text-3 date' onchange='computeWorkDays()'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->project->end;?></th>
|
||||
<td><?php echo html::input('end', '', "class='text-3 date' onchange='computeDays()'");?></td>
|
||||
<td><?php echo html::input('end', '', "class='text-3 date' onchange='computeWorkDays()'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->project->days;?></th>
|
||||
|
||||
@@ -26,11 +26,11 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->project->begin;?></th>
|
||||
<td><?php echo html::input('begin', $project->begin, "class='text-3 date' onchange='computeDays()'");?></td>
|
||||
<td><?php echo html::input('begin', $project->begin, "class='text-3 date' onchange='computeWorkDays()'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->project->end;?></th>
|
||||
<td><?php echo html::input('end', $project->end, "class='text-3 date' onchange='computeDays()'");?></td>
|
||||
<td><?php echo html::input('end', $project->end, "class='text-3 date' onchange='computeWorkDays()'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->project->days;?></th>
|
||||
|
||||
Reference in New Issue
Block a user