$dbParams['entity_value'] = $formParams['parent_event_id'];
}
- if(CRM_Utils_Array::value('repetition_start_date', $formParams)){
- $repetition_start_date = new DateTime($formParams['repetition_start_date']);
+ if(CRM_Utils_Array::value('repetition_start_date', $formParams) &&
+ CRM_Utils_Array::value('repetition_start_date_time', $formParams)){
+ $repetition_start_date = new DateTime($formParams['repetition_start_date']." ".$formParams['repetition_start_date_time']);
$repetition_start_date->modify('+1 day');
$dbParams['entity_status'] = CRM_Utils_Date::processDate($repetition_start_date->format('Y-m-d H:i:s'));
}
$form->add('select', 'repetition_frequency_unit', ts('Repeats:'), $freqUnitsDisplay, TRUE);
$numericOptions = CRM_Core_SelectValues::getNumericOptions(1, 30);
$form->add('select', 'repetition_frequency_interval', ts('Repeats every:'), $numericOptions, TRUE, array('style' => 'width:55px;'));
- $form->addDate('repetition_start_date', ts('Repetition Start Date'), array(), FALSE);
+ $form->addDateTime('repetition_start_date', ts('Repetition Start Date'), FALSE, array('formatType' => 'activityDateTime'));
foreach($dayOfTheWeek as $key => $val){
$startActionCondition[] = $form->createElement('checkbox', $key, NULL, substr($val." ", 0, 3));
}
//Set Schedule Reminder Id
$this->_scheduleReminderId = $this->_scheduleReminderDetails->id;
- list($defaults['repetition_start_date']) = CRM_Utils_Date::setDateDefaults($this->_parentEventStartDate);
+ list($defaults['repetition_start_date'], $defaults['repetition_start_date_time']) = CRM_Utils_Date::setDateDefaults($this->_parentEventStartDate, 'activityDateTime');
// Check if there is id for this event in Reminder table
if($this->_scheduleReminderId){
- list($defaults['repetition_start_date']) = CRM_Utils_Date::setDateDefaults($this->_scheduleReminderDetails->entity_status);
+ list($defaults['repetition_start_date'], $defaults['repetition_start_date_time']) = CRM_Utils_Date::setDateDefaults($this->_scheduleReminderDetails->entity_status, 'activityDateTime');
$defaults['repetition_frequency_unit'] = $this->_scheduleReminderDetails->repetition_frequency_unit;
$defaults['repetition_frequency_interval'] = $this->_scheduleReminderDetails->repetition_frequency_interval;
$defaults['start_action_condition'] = array_flip(explode(",",$this->_scheduleReminderDetails->start_action_condition));