Configurable

ReplaceDateTimeRangeConstantsRector

Replace removed DateTimeRangeConstantsInterface constants and datetime_type_field_views_data_helper() with Drupal 12 equivalents

-DateTimeRangeConstantsInterface::BOTH;
+\Drupal\datetime_range\DateTimeRangeDisplayOptions::Both->value;

Configure your rector.php:

<?php

use DrupalRector\Drupal11\Rector\Deprecation\ReplaceDateTimeRangeConstantsRector;
use DrupalRector\Rector\ValueObject\DrupalIntroducedVersionConfiguration;
use Rector\Config\RectorConfig;

return RectorConfig::configure()
    ->withConfiguredRule(ReplaceDateTimeRangeConstantsRector::class, [
        new DrupalIntroducedVersionConfiguration('11.2.0'),
    ]);

-datetime_type_field_views_data_helper($field_storage, $data, $column);
+\Drupal::service('datetime.views_helper')->buildViewsData($field_storage, $data, $column);

Configure your rector.php:

<?php

use DrupalRector\Drupal11\Rector\Deprecation\ReplaceDateTimeRangeConstantsRector;
use DrupalRector\Rector\ValueObject\DrupalIntroducedVersionConfiguration;
use Rector\Config\RectorConfig;

return RectorConfig::configure()
    ->withConfiguredRule(ReplaceDateTimeRangeConstantsRector::class, [
        new DrupalIntroducedVersionConfiguration('11.2.0'),
    ]);