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.
12 class DateFormatDeleteForm extends EntityDeleteForm {
15 * The date formatter service.
17 * @var \Drupal\Core\Datetime\DateFormatterInterface
19 protected $dateFormatter;
22 * Constructs an DateFormatDeleteForm object.
24 * @param \Drupal\Core\Datetime\DateFormatterInterface $date_formatter
25 * The date formatter service.
27 public function __construct(DateFormatterInterface $date_formatter) {
28 $this->dateFormatter = $date_formatter;
34 public static function create(ContainerInterface $container) {
36 $container->get('date.formatter')
43 public function getQuestion() {
44 return t('Are you sure you want to delete the format %name : %format?', [
45 '%name' => $this->entity->label(),
46 '%format' => $this->dateFormatter->format(REQUEST_TIME, $this->entity->id())]