2011-12-21 14 views
1
$years = range(2009, 2020); 
$month = range ???; 
$days = range ???; 

$w = new sfWidgetFormDate(
    array('years' => array_combine($years, $years), 
     'month' => array_combine($month, $month), 
     'days' => array_combine($days, $days), 
) 
); 

この例では、実際の日付で過去0日から未来40日までどのようにすればいいですか?sfWidgetFormDate - 今後40日、過去0日

答えて

0
<?php 
$years = array_unique(array(date('Y'), date('Y', strtotime('+40 days')))); 
$months = array_unique(array(date('m'), date('m', strtotime('first day of next month')), date('m', strtotime('+40 days')))); 
$days = range(date('d'), 31); 
0
format('Y'); $yr_init = $yr_actual-10; $years = range($yr_actual,$yr_init); 
$this->widgetSchema['bcg_1'] = new sfWidgetFormDate(array('format' => 
    '%day%/%month%/%year%','years'=>array_combine($years, $years))); ?> 
関連する問題