A little problem with date_helper |
[eluser]Unknown[/eluser]
I'm starting with CI and I was looking for a way to display the name of month. I've discovered the date_helper and when looking into http://ellislab.com/codeigniter/user-gui...elper.html I found the mdate(). It says that Quote:This function is identical to PHPs date() function, except that it lets you use MySQL style date codes, where each code letter is preceded with a percent sign: %Y %m %d etc. But I tryed to get the month name and I got caught in this line of the mdate() method. Code: $datestr = str_replace('%\\', '', preg_replace("/([a-z]+?){1}/i", "\\\\\\1", $datestr)); The problem is that for date('F') I got February for mdate('F') I got F. I don't know how much I can change this str_replace and maintain it working for all the other functions (that I probably haven't figured yet). I'm noobie to regular expressions as well... In second place I have to translate the name of the month to Portuguese. Thanks for reading and thinking about it... |
Messages In This Thread |
A little problem with date_helper - by El Forum - 02-07-2011, 05:46 PM
A little problem with date_helper - by El Forum - 02-07-2011, 08:57 PM
A little problem with date_helper - by El Forum - 02-11-2011, 01:48 PM
|