我得到准确的结果,如果我设定开始日期和结束日期时,年份是2017年。但是,当开始日期15月-2016到15日至2017年它不工作,并显示错误MESSAGE-笨开始和结束日期验证
$error = "End date can't be older than begin date ";
这里是我的代码
$data['beginDate'] = $this->input->post('beginDate');
$data['endDate'] = $this->input->post('endDate');
if($data['endDate'] < $data['beginDate']){
$error = "End date can't be older than begin date ";
$this->session->set_flashdata('error', $error);
redirect('/search');
}
else{
$this->load->model('personhistory');
$data['rets'] = $this->personhistory->searchDetails();
$data['sum'] = $this->personhistory->searchDetailsSum();
$data['title'] = "Search Details";
$this->load->view('search_results', $data);
}
有什么解决方案来摆脱这个问题的?请帮助...
请清楚地了解你的测试/例子输入是什么。导致错误的'$ data ['beginDate']'和'$ data ['endDate']'的确切值是什么? –
这些值是使用JQuery日历选择的日期 – user3311692
您有时间机器吗?我不这么认为。十月总是在我的日历上九月之后。 –