Example #1
0
 protected function _actionPost(KCommandContext $context)
 {
     $data = $context->data;
     $date = new KDate();
     $date->day((int) $data->expiresOnDay);
     $date->month((int) $data->expiresOnMonth);
     $date->year((int) $data->expiresOnYear);
     $data->expiresOn = $date;
     return parent::_actionPost($context);
 }
 public function getDates()
 {
     static $result;
     if (!isset($result)) {
         $year = $this->getState('year');
         $month = $this->getState('month');
         $days = KDate::getDaysInMonth($month, $year);
         $date = new KDate();
         $date->year($year);
         $date->month($month);
         $result = array();
         for ($day = 1; $day <= $days; $day++) {
             $date->day($day);
             $result[$date->format('%Y-%m-%d')] = 0;
         }
     }
     return $result;
 }
Example #3
0
 /**
  * Set End Time action
  * 
  * sets correct end date value to be used for a subscription setting 
  *
  * @param KCommandContext $context Context parameter
  * 
  * @param void
  */
 public function setEndDate(KCommandContext $context)
 {
     $data = $context->data;
     if ($data->day || $data->month || $data->year) {
         $date = new KDate();
         $date->day((int) $data->day);
         $date->month((int) $data->month);
         $date->year((int) $data->year);
         $data->endDate = $date;
     }
 }