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

        $date = \DateTime::createFromFormat($attribute->getDateTimeFormatString(), $event->getValue());

        if ($date) {
            $event->setValue($date->getTimestamp());
        }
    }
public function handleEncodePropertyValueFromWidget(EncodePropertyValueFromWidgetEvent $event)
    {
        $attribute = $this->getSupportedAttribute($event);
        if (!$attribute) {
            return;
        }

        $date = \DateTime::createFromFormat($attribute->getDateTimeFormatString(), $event->getValue());

        if ($date) {
            $event->setValue($date->getTimestamp());
        }
    }
public function handleEncodePropertyValueFromWidget ( EncodePropertyValueFromWidgetEvent $ event ) { $ attribute = $ this -> getSupportedAttribute ( $ event ) ; if ( ! $ attribute ) { return ; } $ date = \ DateTime :: createFromFormat ( $ attribute -> getDateTimeFormatString ( ) , $ event -> getValue ( ) ) ; if ( $ date ) { $ event -> setValue ( $ date -> getTimestamp ( ) ) ; } }
Encode an timestamp attribute value from a widget value.

@param EncodePropertyValueFromWidgetEvent $event The subscribed event.

@return void
Encode an timestamp attribute value from a widget value .