Skip to content

Commit

Permalink
Fixes probleme with parameter dateFormat (see #36 )
Browse files Browse the repository at this point in the history
  • Loading branch information
cliffparnitzky committed Mar 27, 2017
1 parent 2527729 commit 9984870
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ public function parse($arrAttributes=null)
$GLOBALS['TL_JAVASCRIPT'][] = TL_ASSETS_URL . 'assets/jquery/ui/'.JQUERY_UI.'/jquery-ui.min.js';
$GLOBALS['TL_JAVASCRIPT'][] = TL_ASSETS_URL . 'assets/hofff/calendarfield/jquery.ui.datepicker/'.JQUERY_UI.'/jquery.ui.datepicker.min.js';
$GLOBALS['TL_JAVASCRIPT'][] = TL_ASSETS_URL . 'assets/hofff/calendarfield/jquery.ui.datepicker/'.JQUERY_UI.'/i18n/jquery.ui.datepicker-' . $objPage->language . '.js';

$dateFormat = $this->dateFormat ?: $GLOBALS['TL_CONFIG'][$this->rgxp . 'Format'];
$dateFormat = $this->dateFormat ? $this->dateFormat : $objPage->dateFormat;

if ($this->dateParseValue && $this->varValue != '') {
$this->varValue = \Date::parse($dateFormat, strtotime($this->varValue));
Expand Down Expand Up @@ -129,7 +129,7 @@ public function parse($arrAttributes=null)
}

// correctly style the date format
$arrConfig['format'] = $this->dateformat_PHP_to_jQueryUI($dateFormat);
$arrConfig['dateFormat'] = $this->dateformat_PHP_to_jQueryUI($dateFormat);

if (is_array($this->dateConfig)) {
$arrConfig = array_replace($arrConfig, $this->dateConfig);
Expand Down

0 comments on commit 9984870

Please sign in to comment.