Skip to content

Commit

Permalink
#1678 source fb marketing: another fix
Browse files Browse the repository at this point in the history
  • Loading branch information
davydov-d committed Apr 14, 2023
1 parent 4cd0414 commit 2c0f791
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def validate_start_date(start_date: DateTime) -> DateTime:
now = pendulum.now(tz=start_date.tzinfo)
today = now.replace(microsecond=0, second=0, minute=0, hour=0)
retention_date = today.subtract(months=DATA_RETENTION_PERIOD)
if retention_date.day != start_date.day:
if retention_date.day != today.day:
# `.subtract(months=37)` can be erroneous, for instance:
# 2023-03-31 - 37 month = 2020-02-29 which is incorrect, should be 2020-03-01
# that's why we're adjusting the date to the 1st day of the next month
Expand Down

0 comments on commit 2c0f791

Please sign in to comment.