本文整理汇总了PHP中CDate::subtractSpan方法的典型用法代码示例。如果您正苦于以下问题:PHP CDate::subtractSpan方法的具体用法?PHP CDate::subtractSpan怎么用?PHP CDate::subtractSpan使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDate
的用法示例。
在下文中一共展示了CDate::subtractSpan方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Cezpdf
$pname = db_loadResult($sql);
} else {
$pname = $AppUI->_('All Projects');
}
$font_dir = $dPconfig['root_dir'] . "/lib/ezpdf/fonts";
$temp_dir = $dPconfig['root_dir'] . "/files/temp";
$base_url = $dPconfig['base_url'];
require $AppUI->getLibraryClass('ezpdf/class.ezpdf');
$pdf =& new Cezpdf($paper = 'A4', $orientation = 'landscape');
$pdf->ezSetCmMargins(1, 2, 1.5, 1.5);
$pdf->selectFont("{$font_dir}/Helvetica.afm");
$pdf->ezText(dPgetConfig('company_name'), 12);
$date = new CDate();
$pdf->ezText("\n" . $date->format($df), 8);
$last_week = new CDate($date);
$last_week->subtractSpan(new Date_Span(array(7, 0, 0, 0)));
$pdf->selectFont("{$font_dir}/Helvetica-Bold.afm");
$pdf->ezText("\n" . $AppUI->_('Project Completed Task Report'), 12);
$pdf->ezText("{$pname}", 15);
$pdf->ezText($AppUI->_('Tasks Completed Since') . " " . $last_week->format($df), 10);
$pdf->ezText("\n");
$pdf->selectFont("{$font_dir}/Helvetica.afm");
$title = null;
$options = array('showLines' => 2, 'showHeadings' => 1, 'fontSize' => 9, 'rowGap' => 4, 'colGap' => 5, 'xPos' => 50, 'xOrientation' => 'right', 'width' => '750', 'shaded' => 0, 'cols' => array(0 => array('justification' => 'left', 'width' => 250), 1 => array('justification' => 'left', 'width' => 95), 2 => array('justification' => 'center', 'width' => 75), 3 => array('justification' => 'center', 'width' => 75), 4 => array('justification' => 'center', 'width' => 75)));
$hasResources = $AppUI->isActiveModule('resources');
$perms =& $AppUI->acl();
if ($hasResources) {
$hasResources = $perms->checkModule('resources', 'view');
}
// Build the data to go into the table.
$pdfdata = array();
示例2: CDate
$days = $period_value;
} else {
if ($day_word == $AppUI->_("Week")) {
$days = 7 * $period_value;
} else {
if ($day_word == $AppUI->_("Month")) {
$days = 30 * $period_value;
}
}
}
$start_date = new CDate($ts);
$end_date = new CDate($ts);
if ($sign > 0) {
$end_date->addSpan(new Date_Span("{$days},0,0,0"));
} else {
$start_date->subtractSpan(new Date_Span("{$days},0,0,0"));
}
$do_report = 1;
} else {
// create Date objects from the datetime fields
$start_date = intval($list_start_date) ? new CDate($list_start_date) : new CDate();
$end_date = intval($list_end_date) ? new CDate($list_end_date) : new CDate();
}
if (!$list_start_date) {
$start_date->subtractSpan(new Date_Span("14,0,0,0"));
}
$end_date->setTime(23, 59, 59);
?>
<script language="javascript">
Calendar.enabled = true;
</script>