Skip to content

Commit

Permalink
Merge pull request iandees#13 from estahn/patch-1
Browse files Browse the repository at this point in the history
fix: today in unreliable
  • Loading branch information
iandees authored Mar 3, 2021
2 parents dea7cd8 + 6447a9e commit 5d56202
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import sys

n_days = 7
today = datetime.datetime.today()
week_ago = today - datetime.timedelta(days=n_days)
yesterday = datetime.datetime.today() - datetime.timedelta(days=1)
week_ago = yesterday - datetime.timedelta(days=n_days)

# It seems that the sparkline symbols don't line up (probalby based on font?) so put them last
# Also, leaving out the full block because Slack doesn't like it: '█'
Expand Down Expand Up @@ -50,7 +50,7 @@ def report_cost(event, context):
query = {
"TimePeriod": {
"Start": week_ago.strftime('%Y-%m-%d'),
"End": today.strftime('%Y-%m-%d'),
"End": yesterday.strftime('%Y-%m-%d'),
},
"Granularity": "DAILY",
"Filter": {
Expand Down

0 comments on commit 5d56202

Please sign in to comment.