3 namespace Drupal\system\Form;
5 use Drupal\Core\Datetime\DateFormatterInterface;
6 use Drupal\Core\Entity\EntityDeleteForm;
7 use Symfony\Component\DependencyInjection\ContainerInterface;
10 * Builds a form to delete a date format.
14 class DateFormatDeleteForm extends EntityDeleteForm {
17 * The date formatter service.
19 * @var \Drupal\Core\Datetime\DateFormatterInterface
21 protected $dateFormatter;
24 * Constructs an DateFormatDeleteForm object.
26 * @param \Drupal\Core\Datetime\DateFormatterInterface $date_formatter
27 * The date formatter service.
29 public function __construct(DateFormatterInterface $date_formatter) {
30 $this->dateFormatter = $date_formatter;
36 public static function create(ContainerInterface $container) {
38 $container->get('date.formatter')
45 public function getQuestion() {
46 return t('Are you sure you want to delete the format %name : %format?', [
47 '%name' => $this->entity->label(),
48 '%format' => $this->dateFormatter->format(REQUEST_TIME, $this->entity->id()),