number of days bug in portfolio features fixed

This commit is contained in:
Justin 2023-07-11 16:04:17 +08:00 committed by GitHub
parent 58474f8eea
commit f3f99e6ee6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1061,6 +1061,9 @@ class StockTicker():
try:
cost = portfolio_settings[cb]['cost']
day = portfolio_settings[cb]['day']
day_start = datetime.strptime(str(day), "%Y-%m-%d")
day_today = datetime.strptime(datetime.now(pytz.utc).strftime("%Y-%m-%d"), "%Y-%m-%d")
day = str((day_today - day_start).days)
shares = portfolio_settings[cb]['shares']
original_value = float(cost) * float(shares)
@ -1230,6 +1233,9 @@ class StockTicker():
try:
cost = portfolio_settings[cb]['cost']
day = portfolio_settings[cb]['day']
day_start = datetime.strptime(str(day), "%Y-%m-%d")
day_today = datetime.strptime(datetime.now(pytz.utc).strftime("%Y-%m-%d"), "%Y-%m-%d")
day = str((day_today - day_start).days)
shares = portfolio_settings[cb]['shares']
original_value = float(cost) * float(shares)
@ -2020,6 +2026,9 @@ class StockTicker():
try:
cost = portfolio_settings[symbol]['cost']
day = portfolio_settings[symbol]['day']
day_start = datetime.strptime(str(day), "%Y-%m-%d")
day_today = datetime.strptime(datetime.now(pytz.utc).strftime("%Y-%m-%d"), "%Y-%m-%d")
day = str((day_today - day_start).days)
shares = portfolio_settings[symbol]['shares']
original_value = float(cost) * float(shares)
@ -2286,6 +2295,9 @@ class StockTicker():
try:
cost = portfolio_settings[symbol]['cost']
day = portfolio_settings[symbol]['day']
day_start = datetime.strptime(str(day), "%Y-%m-%d")
day_today = datetime.strptime(datetime.now(pytz.utc).strftime("%Y-%m-%d"), "%Y-%m-%d")
day = str((day_today - day_start).days)
shares = portfolio_settings[symbol]['shares']
original_value = float(cost) * float(shares)