namespace Drupal\node\Form;
+use Drupal\Component\Datetime\TimeInterface;
use Drupal\Core\Datetime\DateFormatterInterface;
use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Form\FormStateInterface;
* The date formatter service.
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* The language manager.
+ * @param \Drupal\Component\Datetime\TimeInterface $time
+ * The time service.
*/
- public function __construct(EntityStorageInterface $node_storage, DateFormatterInterface $date_formatter, LanguageManagerInterface $language_manager) {
- parent::__construct($node_storage, $date_formatter);
+ public function __construct(EntityStorageInterface $node_storage, DateFormatterInterface $date_formatter, LanguageManagerInterface $language_manager, TimeInterface $time) {
+ parent::__construct($node_storage, $date_formatter, $time);
$this->languageManager = $language_manager;
}
return new static(
$container->get('entity.manager')->getStorage('node'),
$container->get('date.formatter'),
- $container->get('language_manager')
+ $container->get('language_manager'),
+ $container->get('datetime.time')
);
}