Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

23072 - Statement - from_date / to_date - Fix UTC, add 8 hours so GUI shows it in PDT/PST #1752

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pay-api/src/pay_api/models/statement.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"""Model to handle statements data."""
from __future__ import annotations
from typing import List
from dateutil.relativedelta import relativedelta

from attr import define
import pytz
Expand Down Expand Up @@ -131,9 +132,9 @@ def from_row(cls, row):
https://www.attrs.org/en/stable/init.html

"""
return cls(id=row.id, frequency=row.frequency, from_date=row.from_date,
return cls(id=row.id, frequency=row.frequency, from_date=(row.from_date + relativedelta(hours=8)).isoformat(),
is_interim_statement=row.is_interim_statement, payment_methods=row.payment_methods,
to_date=row.to_date)
to_date=(row.to_date + relativedelta(hours=8)).isoformat())

@classmethod
def dao_to_dict(cls, statement_daos: List[Statement]) -> dict[StatementDTO]:
Expand Down
Loading