Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Problem Searching By Date Different Format

$
0
0
Hi veryone , I show the dates on my gridviews like d-m-y and when I'am gonna use the search, it doesn't work obviously because when yii compare one date is format like Y-m-d(model) and in the gridView is like d-m-Y so I tried to fix it changin on the model the compare instructiond search in function search like :

//instead of this:
$criteria->compare('date1',$this->date1,true);
//I used this.
$criteria->compare('date("d-m-Y",strtotime(date1))',$this->date1,true);

But this doen't work, can anyone help me??

Thanks!

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>