File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
weather_provider_api/routers/weather/utils Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 11[tool .poetry ]
22name = " weather_provider_api"
3- version = " 2.62.0 "
3+ version = " 2.62.50 "
44description = " Weather Provider Libraries and API"
55authors = [
" Verbindingsteam" ,
" Raoul Linnenbank <[email protected] >" ]
66license = " MPL-2.0"
Original file line number Diff line number Diff line change 1111import pandas as pd
1212from fastapi import HTTPException
1313from loguru import logger
14+ from pytz import UTC
1415
1516
1617def parse_datetime (
@@ -66,9 +67,14 @@ def validate_begin_and_end(
6667 """Checks the given date parameters and replaces them with default values if they aren't valid.
6768 The resulting values are then returned.
6869 """
70+ start = start .astimezone (UTC ) if start else None
71+ end = end .astimezone (UTC ) if end else None
72+ data_start = data_start .astimezone (UTC ) if data_start else None
73+ data_end = data_end .astimezone (UTC ) if data_end else None
74+
6975 if data_end is None :
7076 # Assuming predictions fill in this value, the most recent value for the past is before "now".
71- data_end = datetime .utcnow ( )
77+ data_end = datetime .now ( UTC )
7278
7379 if data_start is not None and data_start > start :
7480 # If the starting moment lies before what can be requested, put it at the moment from which it can be requested
You can’t perform that action at this time.
0 commit comments