diff --git a/stubs/DateTimeRange/METADATA.toml b/stubs/DateTimeRange/METADATA.toml index f52202108..a682c0c1f 100644 --- a/stubs/DateTimeRange/METADATA.toml +++ b/stubs/DateTimeRange/METADATA.toml @@ -1,2 +1,5 @@ version = "1.2.*" requires = ["types-python-dateutil"] + +[tool.stubtest] +ignore_missing_stub = false diff --git a/stubs/DateTimeRange/datetimerange/__init__.pyi b/stubs/DateTimeRange/datetimerange/__init__.pyi index 27160b820..2596cbcdd 100644 --- a/stubs/DateTimeRange/datetimerange/__init__.pyi +++ b/stubs/DateTimeRange/datetimerange/__init__.pyi @@ -1,11 +1,15 @@ import datetime from _typeshed import Self from collections.abc import Iterable +from typing import ClassVar from dateutil.relativedelta import relativedelta +__license__: str +__email__: str + class DateTimeRange: - NOT_A_TIME_STR: str + NOT_A_TIME_STR: ClassVar[str] start_time_format: str end_time_format: str is_output_elapse: bool @@ -17,6 +21,10 @@ class DateTimeRange: start_time_format: str = ..., end_time_format: str = ..., ) -> None: ... + @classmethod + def from_range_text( + cls, range_text: str, separator: str = ..., start_time_format: str | None = ..., end_time_format: str | None = ... + ) -> DateTimeRange: ... def __eq__(self, other: object) -> bool: ... def __ne__(self, other: object) -> bool: ... def __add__(self, other: datetime.timedelta) -> DateTimeRange: ... @@ -44,3 +52,5 @@ class DateTimeRange: def intersection(self, x: DateTimeRange) -> DateTimeRange: ... def encompass(self, x: DateTimeRange) -> DateTimeRange: ... def truncate(self, percentage: float) -> None: ... + def split(self, separator: str | datetime.datetime) -> list[DateTimeRange]: ... + def subtract(self, x: DateTimeRange) -> DateTimeRange: ...