function eventOnDate($testDate, $multidayTreatment = 0)
{
if (!isset($this->_startday))
{
$this->_startday = JevDate::mktime(0, 0, 0, $this->mup(), $this->dup(), $this->yup());
$this->_startday_plus1 = JevDate::mktime(0, 0, 0, $this->mup(), $this->dup()+1, $this->yup());
$this->_endday = JevDate::mktime(0, 0, 0, $this->mdn(), $this->ddn(), $this->ydn());
// if ends on midnight then testing day should ignore the second day since no one wants this event to show
if ($this->hdn() + $this->mindn() + $this->sdn() == 0 && $this->_startday != $this->_endday)
{
$this->_endday = JevDate::mktime(0, 0, 0, $this->mdn(), $this->ddn()-1, $this->ydn());
}
//check both DST
$atual = $testDate;
$atual_localtime = localtime($atual,true);
$atual_horario_verao = $atual_localtime['tm_isdst'];
$date_localtime = localtime($this->_startday,true);
$date_horario_verao = $date_localtime['tm_isdst'];
//correct the hours
if($atual_horario_verao && !$date_horario_verao)
{
$this->_startday -= 3600;
$this->_endday -= 3600;
}
else if(!$atual_horario_verao && $date_horario_verao)
{
$this->_startday += 3600;
$this->_endday += 3600;
}
}
if ($this->_startday <= $testDate && $this->_endday >= $testDate)
{
// if only show on first day
if ($multidayTreatment == 2 && $testDate >= $this->_startday_plus1)
{
return false;
}
// don't show multiday suppressed events after the first day if multiday is not true
if ($multidayTreatment == 0)
{
if (!$this->_multiday && $testDate >= $this->_startday_plus1)
{
return false;
}
}
return true;
}
else
return false;
}
Unlike many Joomla calendars we do not charge to download JEvents - please show your support for this project by becoming a member of the JEvents Club Club members get access to early releases, exclusive member support forums, and Silver and Gold members can use many exciting JEvents addons
Your membership will ensure that JEvents continues to be the best events calendar for Joomla.
GWE Systems Ltd, the company behind JEvents, is excited to announce the preview release of EasyLayouts - the tool that makes it easy to create layouts for your Joomla content and custom fields.
See our blog post for an exciting special offer to our Gold Members