mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-16 00:37:10 +08:00
DateTimeRange: complete stubs (#8168)
Co-authored-by: hauntsaninja <> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
@@ -1,2 +1,5 @@
|
||||
version = "1.2.*"
|
||||
requires = ["types-python-dateutil"]
|
||||
|
||||
[tool.stubtest]
|
||||
ignore_missing_stub = false
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user