extract leading zero from date

This commit is contained in:
Khalim Conn-Kowlessar 2024-07-02 12:00:24 +01:00
parent 3b3c6c3cc4
commit 298bb5a148

View file

@ -24,7 +24,7 @@ BASE_ENERGY_URL = "https://find-energy-certificate.service.gov.uk"
def calculate_expiry_date(lodgement_date):
lodgement_date_dt = datetime.strptime(lodgement_date, '%Y-%m-%d')
expiry_date_dt = lodgement_date_dt + relativedelta(years=10) - timedelta(days=1)
return expiry_date_dt.strftime('%d %B %Y')
return expiry_date_dt.strftime('%-d %B %Y')
def retrieve_find_my_epc_data(uprn: int, postcode: str, address: str, expected_expiry_date: str):