Skip to content

Commit

Permalink
Dates remaining now calculated
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Neylon committed Mar 4, 2012
1 parent 8ea1b9d commit 2cecb55
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion fundraising-gauge.php
Expand Up @@ -35,7 +35,15 @@ public function investors($instance) {
}

function days_to_go($instance) {
return 6;
date_default_timezone_set('Europe/London');
$startDate = time();
$endDate = strtotime('2012-03-10');
if ($endDate < $startDate)
{
return 0;
}
$numDays = intval(date('d', $endDate - $startDate));
return $numDays;
}

public function widget( $args, $instance ) {
Expand Down

0 comments on commit 2cecb55

Please sign in to comment.