Skip to content

Commit

Permalink
*: rename date to datetime
Browse files Browse the repository at this point in the history
  • Loading branch information
null8626 committed Mar 6, 2024
1 parent 11c8a16 commit a2d6282
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
11 changes: 6 additions & 5 deletions changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,13 @@ changelog:
release-date: March 2024
changes:
- rem: Rename the main forecast's class name from ``Weather`` to :class:`Forecast`.
- rem: Merge ``CurrentForecast`` class' properties with :class:`Forecast`. Therefore the ``current`` property is removed.
- rem: Merge ``CurrentForecast`` class' properties with :class:`Forecast`'s. Therefore the ``current`` property is removed.
- rem: Merge ``Area`` class' properties with :class:`Forecast`.
- rem: Rename ``Forecast.forecasts`` to ``Forecast.daily_forecasts``.
- rem: Rename ``Forecast.location`` to ``Forecast.coordinates``. The former now returns the forecast location's name and the latter is no longer an optional type.
- rem: Rename ``Forecast.chances_of_hightemp`` to ``Forecast.chances_of_high_temperature``.
- rem: Remove ``Forecast.chances_of_remdry``, use ``Forecast.chances_of_remaining_dry`` instead.
- rem: Rename ``Weather.forecasts`` to ``Forecast.daily_forecasts``.
- rem: Rename ``Weather.location`` to ``Forecast.coordinates``. The former now returns the forecast location's name and the latter is no longer an optional type.
- rem: Rename ``CurrentForecast.chances_of_hightemp`` to ``Forecast.chances_of_high_temperature``.
- rem: Rename ``CurrentForecast.chances_of_remdry`` to ``Forecast.chances_of_remaining_dry``.
- rem: Rename ``CurrentForecast.date`` to ``Forecast.datetime``.
- rem: Rename ``DailyForecast.hourly`` to ``DailyForecast.hourly_forecasts``.
- rem: Merge ``Astronomy`` class' properties with :class:`DailyForecast`.
- rem: Rename ``Astronomy.sun_rise`` to ``DailyForecast.sunrise``.
Expand Down
4 changes: 2 additions & 2 deletions python_weather/forecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,8 @@ def country(self) -> str:
return self.__nearest['country'][0]['value']

@property
def date(self) -> datetime:
"""The local date of this weather forecast."""
def datetime(self) -> datetime:
"""The local datetime of this weather forecast."""

return datetime.strptime(
self._BaseForecast__inner['localObsDateTime'], '%Y-%m-%d %I:%M %p'
Expand Down

0 comments on commit a2d6282

Please sign in to comment.