public function setDefaultValues() {
$defaults = $this->_values;
- if (isset($defaults['start_date'])) {
- list($defaults['start_date'], $defaults['start_date_time'])
- = CRM_Utils_Date::setDateDefaults($defaults['start_date'], 'activityDateTime');
- }
- else {
- list($defaults['start_date'], $defaults['start_date_time'])
- = CRM_Utils_Date::setDateDefaults();
- }
-
- if (isset($defaults['end_date'])) {
- list($defaults['end_date'], $defaults['end_date_time'])
- = CRM_Utils_Date::setDateDefaults($defaults['end_date'], 'activityDateTime');
+ if (empty($defaults['start_date'])) {
+ $defaults['start_date'] = date('Y-m-d H:i:s');
}
if (!isset($defaults['is_active'])) {
$this->add('textarea', 'description', ts('Description'), $attributes['description']);
// add campaign start date
- $this->addDateTime('start_date', ts('Start Date'), TRUE, array('formatType' => 'activityDateTime'));
+ $this->add('datepicker', 'start_date', ts('Start Date'), [], TRUE);
// add campaign end date
- $this->addDateTime('end_date', ts('End Date'), FALSE, array('formatType' => 'activityDateTime'));
+ $this->add('datepicker', 'end_date', ts('End Date'));
// add campaign type
$this->addSelect('campaign_type_id', array('onChange' => "CRM.buildCustomData( 'Campaign', this.value );"), TRUE);
$params['created_date'] = date('YmdHis');
}
// format params
- $params['start_date'] = CRM_Utils_Date::processDate($params['start_date'], $params['start_date_time']);
- $params['end_date'] = CRM_Utils_Date::processDate($params['end_date'], $params['end_date_time'], TRUE);
$params['is_active'] = CRM_Utils_Array::value('is_active', $params, FALSE);
$params['last_modified_id'] = $session->get('userID');
$params['last_modified_date'] = date('YmdHis');
</tr>
<tr class="crm-campaign-form-block-start_date">
<td class="label">{$form.start_date.label}</td>
- <td class="view-value">{include file="CRM/common/jcalendar.tpl" elementName=start_date}
- </td>
+ <td class="view-value">{$form.start_date.html}</td>
</tr>
<tr class="crm-campaign-form-block-end_date">
<td class="label">{$form.end_date.label}</td>
- <td class="view-value">{include file="CRM/common/jcalendar.tpl" elementName=end_date}</td>
+ <td class="view-value">{$form.end_date.html}</td>
</tr>
<tr class="crm-campaign-form-block-status_id">
<td class="label">{$form.status_id.label}</td>