source/Core/UtilsDate.php
protected function _setDefaultFormatedValue($oObject, $sDate, $sLocalDateFormat, $sLocalTimeFormat, $blOnlyDate)
    {
        $aDefTimePatterns = $this->_defaultTimePattern();
        $aDFormats = $this->_defineDateFormattingRules();
        $aTFormats = $this->_defineTimeFormattingRules();
        $oStr = getStr();

        foreach (array_keys($aDefTimePatterns) as $sDefTimePattern) {
            if ($oStr->preg_match($sDefTimePattern, $sDate)) {
                $blDefTimeFound = true;
                break;
            }
        }

        // setting and returning default formatted value
        if ($blOnlyDate) {
            $oObject->setValue(trim($aDFormats[$sLocalDateFormat][2])); // . " " . @$aTFormats[$sLocalTimeFormat][2]);
            // increasing(decreasing) field length
            $oObject->fldmax_length = strlen($oObject->value);

            return;
        } elseif ($blDefTimeFound) {
            // setting value
            $oObject->setValue(trim($aDFormats[$sLocalDateFormat][2] . " " . $aTFormats[$sLocalTimeFormat][2]));
            // increasing(decreasing) field length
            $oObject->fldmax_length = strlen($oObject->value);

            return;
        }
    }
protected function _setDefaultFormatedValue($oObject, $sDate, $sLocalDateFormat, $sLocalTimeFormat, $blOnlyDate)
    {
        $aDefTimePatterns = $this->_defaultTimePattern();
        $aDFormats = $this->_defineDateFormattingRules();
        $aTFormats = $this->_defineTimeFormattingRules();
        $oStr = getStr();

        foreach (array_keys($aDefTimePatterns) as $sDefTimePattern) {
            if ($oStr->preg_match($sDefTimePattern, $sDate)) {
                $blDefTimeFound = true;
                break;
            }
        }

        // setting and returning default formatted value
        if ($blOnlyDate) {
            $oObject->setValue(trim($aDFormats[$sLocalDateFormat][2])); // . " " . @$aTFormats[$sLocalTimeFormat][2]);
            // increasing(decreasing) field length
            $oObject->fldmax_length = strlen($oObject->value);

            return;
        } elseif ($blDefTimeFound) {
            // setting value
            $oObject->setValue(trim($aDFormats[$sLocalDateFormat][2] . " " . $aTFormats[$sLocalTimeFormat][2]));
            // increasing(decreasing) field length
            $oObject->fldmax_length = strlen($oObject->value);

            return;
        }
    }
protected function _setDefaultFormatedValue ( $ oObject , $ sDate , $ sLocalDateFormat , $ sLocalTimeFormat , $ blOnlyDate ) { $ aDefTimePatterns = $ this -> _defaultTimePattern ( ) ; $ aDFormats = $ this -> _defineDateFormattingRules ( ) ; $ aTFormats = $ this -> _defineTimeFormattingRules ( ) ; $ oStr = getStr ( ) ; foreach ( array_keys ( $ aDefTimePatterns ) as $ sDefTimePattern ) { if ( $ oStr -> preg_match ( $ sDefTimePattern , $ sDate ) ) { $ blDefTimeFound = true ; break ; } } // setting and returning default formatted value if ( $ blOnlyDate ) { $ oObject -> setValue ( trim ( $ aDFormats [ $ sLocalDateFormat ] [ 2 ] ) ) ; // . " " . @$aTFormats[$sLocalTimeFormat][2]); // increasing(decreasing) field length $ oObject -> fldmax_length = strlen ( $ oObject -> value ) ; return ; } elseif ( $ blDefTimeFound ) { // setting value $ oObject -> setValue ( trim ( $ aDFormats [ $ sLocalDateFormat ] [ 2 ] . " " . $ aTFormats [ $ sLocalTimeFormat ] [ 2 ] ) ) ; // increasing(decreasing) field length $ oObject -> fldmax_length = strlen ( $ oObject -> value ) ; return ; } }
sets default formatted value

@param object $oObject          date field object
@param string $sDate            preferred date
@param string $sLocalDateFormat input format
@param string $sLocalTimeFormat local format
@param bool   $blOnlyDate       marker to format only date field (no time)

@return null
sets default formatted value