Wiki

Articles tagged with "date", sorted by viewsX
Displaying 1-3 of 3 result(s).

Local time zones and locales

Created about a year ago by Russell EnglandHow-tos9 comments – viewed 30,093 times – ( +12 / -2 )
Following on from international dates, I also wanted times in the local timezone and format. This was a little more tricky but I think I've got a solution. This is only really appropriate if you have an international app.

Using International Dates

Created 2 years ago by Russell EnglandHow-tos3 comments – viewed 18,934 times – ( +16 )
I needed British (dd/mm/yyyy) formatted dates throughout my application but found it very difficult to find examples of how to do this - until I found this excellent forum post http://www.yiiframework.com/forum/index.php?/topic/3649-dealing-with-i18n-date-formats/

Adding a date range search for CGridView the easy way

Created 2 months ago by mikewalenTips2 comments – viewed 3,600 times – ( +6 )
After a lot of research, everything I found on adding date range searching to a CGridView advanced search form seemed to involve adding two new public variables (e.g. $date_from, $date_to), 'safe' rules for the new variables, and a rather chunky if/elseif/else check in the search() method. This probably isn't a hassle for most, but because many of the tables in my database contain two or three and sometimes four date columns (e.g. date_created, date_modified, date_deleted etc.), it meant I was having to add up to eight public variables, the corresponding safe rules, and modifying the search() criteria for each date attribute. So, I set about creating a better way and I thought I'd share my work with the community.