private function _validateForm() { if (!$this->user->canModify('catalog/product_promotions')) { $this->error['warning'] = $this->language->get('error_permission'); } if (has_value($this->request->post['promotion_type'])) { if ($this->request->post['date_start'] != '0000-00-00' && $this->request->post['date_end'] != '0000-00-00' && $this->request->post['date_start'] != '' && $this->request->post['date_end'] != '' && dateFromFormat($this->request->post['date_start'], $this->language->get('date_format_short')) > dateFromFormat($this->request->post['date_end'], $this->language->get('date_format_short'))) { $this->error['date_end'] = $this->language->get('error_date'); } } $this->extensions->hk_ValidateData($this, __FUNCTION__); if (!$this->error) { return TRUE; } else { return FALSE; } }
function dateDisplay2ISO($string_date, $format = '') { if (empty($format)) { $registry = Registry::getInstance(); $format = $registry->get('language')->get('date_format_short'); } if ($string_date) { return dateInt2ISO(dateFromFormat($string_date, $format)); } else { return ''; } }
private function _validateForm() { if (!$this->user->canModify('catalog/product')) { $this->error['warning'] = $this->language->get('error_permission'); } if ($this->request->post['date_start'] != '0000-00-00' && $this->request->post['date_end'] != '0000-00-00' && dateFromFormat($this->request->post['date_start'], $this->language->get('date_format_short')) > dateFromFormat($this->request->post['date_end'], $this->language->get('date_format_short'))) { $this->error['date_end'] = $this->language->get('error_date'); } if (!$this->error) { return TRUE; } else { return FALSE; } }