public function handleDecodePropertyValueForWidgetEvent(DecodePropertyValueForWidgetEvent $event)
    {
        $attribute = $this->getSupportedAttribute($event);
        if (!$attribute) {
            return;
        }

        $dispatcher = $event->getEnvironment()->getEventDispatcher();
        $value      = $event->getValue();

        if (\is_numeric($value)) {
            $dateEvent = new ParseDateEvent($value, $attribute->getDateTimeFormatString());
            $dispatcher->dispatch(ContaoEvents::DATE_PARSE, $dateEvent);

            $event->setValue($dateEvent->getResult());
        }
    }
public function handleDecodePropertyValueForWidgetEvent(DecodePropertyValueForWidgetEvent $event)
    {
        $attribute = $this->getSupportedAttribute($event);
        if (!$attribute) {
            return;
        }

        $dispatcher = $event->getEnvironment()->getEventDispatcher();
        $value      = $event->getValue();

        if (\is_numeric($value)) {
            $dateEvent = new ParseDateEvent($value, $attribute->getDateTimeFormatString());
            $dispatcher->dispatch(ContaoEvents::DATE_PARSE, $dateEvent);

            $event->setValue($dateEvent->getResult());
        }
    }
public function handleDecodePropertyValueForWidgetEvent ( DecodePropertyValueForWidgetEvent $ event ) { $ attribute = $ this -> getSupportedAttribute ( $ event ) ; if ( ! $ attribute ) { return ; } $ dispatcher = $ event -> getEnvironment ( ) -> getEventDispatcher ( ) ; $ value = $ event -> getValue ( ) ; if ( \ is_numeric ( $ value ) ) { $ dateEvent = new ParseDateEvent ( $ value , $ attribute -> getDateTimeFormatString ( ) ) ; $ dispatcher -> dispatch ( ContaoEvents :: DATE_PARSE , $ dateEvent ) ; $ event -> setValue ( $ dateEvent -> getResult ( ) ) ; } }
Decode an timestamp attribute value for a widget value.

@param DecodePropertyValueForWidgetEvent $event The subscribed event.

@return void
Decode an timestamp attribute value for a widget value .