dateFormatter = $date_formatter; } /** * {@inheritdoc} */ public static function create(ContainerInterface $container) { return new static( $container->get('date.formatter') ); } /** * {@inheritdoc} */ public function getQuestion() { return t('Are you sure you want to delete the format %name : %format?', [ '%name' => $this->entity->label(), '%format' => $this->dateFormatter->format(REQUEST_TIME, $this->entity->id()), ]); } }