self,
        dag: DAG,
        most_recent_dag_run: None | datetime | DataInterval,
    ) -> None:
        """
        Calculate ``next_dagrun`` and `next_dagrun_create_after``.
        :param dag: The DAG object
        :param most_recent_dag_run: DataInterval (or datetime) of most recent run of this dag, or none
            if not yet scheduled.
        """
        most_recent_data_interval: DataInterval | None
        if isinstance(most_recent_dag_run, datetime):
            warnings.warn(
                "Passing a datetime to `DagModel.calculate_dagrun_date_fields` is deprecated. "
                "Provide a data interval instead.",
                RemovedInAirflow3Warning,
                stacklevel=2,
            )
            most_recent_data_interval = dag.infer_automated_data_interval(most_recent_dag_run)
        else:
            most_recent_data_interval = most_recent_dag_run