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
// based on https://gist.github.com/themattharris/1143040 | |
function calc_working_days($from, $to, $normalise = true) | |
{ | |
$_from = is_int($from) ? $from : strtotime($from); | |
$_to = is_int($to) ? $to : strtotime($to); | |
// normalising means partial days are counted as a complete day. | |
if ($normalise) { | |
$_from = strtotime(date('Y-m-d', $_from)); | |
$_to = strtotime(date('Y-m-d', $_to)); |