Skip to content

Commit

Permalink
maybe
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrammatiko committed Sep 1, 2017
1 parent e734a36 commit 3f3d1a5
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions libraries/joomla/form/fields/calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,17 @@ protected function getInput()
// Format value when not nulldate ('0000-00-00 00:00:00'), otherwise blank it as it would result in 1970-01-01.
if ($this->value && $this->value != JFactory::getDbo()->getNullDate() && strtotime($this->value) !== false)
{
$tz = date_default_timezone_get();
date_default_timezone_set('UTC');
$this->value = strftime($this->format, strtotime($this->value));
date_default_timezone_set($tz);
$app = JFactory::getApplication();
$input = $app->input;
$name_input = $input->get($this->name);

if (!empty($name_input))
{
$tz = date_default_timezone_get();
date_default_timezone_set('UTC');
$this->value = strftime($this->format, strtotime($this->value));
date_default_timezone_set($tz);
}
}
else
{
Expand Down

0 comments on commit 3f3d1a5

Please sign in to comment.