Created
April 19, 2011 15:36
-
-
Save matoakley/928485 to your computer and use it in GitHub Desktop.
Extend Kohana's Date helper to return month given as integer to string
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php defined('SYSPATH') or die('No direct script access.'); | |
class Date extends Kohana_Date | |
{ | |
/** | |
* Take a numerical representation of a month (e.g. '04') and return it as a human readable string (e.g. 'April') | |
* | |
* @param mixed numerical representation of month | |
* @return string | |
*/ | |
public static function month2string($month) | |
{ | |
return date('F', mktime(0, 0, 0, $month, 1, date('Y'))); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment