Created
October 7, 2014 11:44
-
-
Save AshleyPinner/f2230ae8307e2f05149c to your computer and use it in GitHub Desktop.
Rough replacement for cal_days_in_month for HHVM
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
if(!function_exists('cal_days_in_month')) { | |
function cal_days_in_month($calendar, $month, $year) { | |
return $month == 2 ? ($year % 4 ? 28 : ($year % 100 ? 29 : ($year % 400 ? 28 : 29))) : (($month - 1) % 7 % 2 ? 30 : 31); | |
} | |
if (!defined('CAL_GREGORIAN')) { | |
define('CAL_GREGORIAN', 1); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment