Skip to content

Commit

Permalink
Merge pull request #222 from cal-itp/fix/report-v2-additions
Browse files Browse the repository at this point in the history
fix: QA from reports site v2 updates
  • Loading branch information
acouch authored Feb 14, 2023
2 parents 95aa42c + 17831e8 commit 8347e89
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion templates/faqs.html.jinja
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends "layout/default.html.jinja" %}
{% import 'macros.html.jinja' as macros %}

{% block title %}FAQs: {{ date_month_year }}{% endblock %}
{% block title %}Frequently Asked Questions{% endblock %}

{% block content %}
<div class="responsive-prose max-w-none">
Expand Down
12 changes: 6 additions & 6 deletions website/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def month_name(month_number):

def datetime_format(value, format="%H:%M %d-%m-%y"):
if isinstance(value, int):
return datetime.fromtimestamp(value / 1e3).strftime(format)
return datetime.utcfromtimestamp(value / 1e3).strftime(format)
return value.strftime(format)

def string_to_html_id(s):
Expand All @@ -70,22 +70,22 @@ def friendly_month(x):
return datetime.strptime(x, "%Y-%m-%d").strftime("%B")

def friendly_month_from_int(x):
return datetime.fromtimestamp(x / 1e3).strftime("%B")
return datetime.utcfromtimestamp(x / 1e3).strftime("%B")

def friendly_month_day(x):
return datetime.strptime(x, "%Y-%m-%d").strftime("%B %d")

def friendly_month_day_from_int(x):
return datetime.fromtimestamp(x / 1e3).strftime("%B %d")
return datetime.utcfromtimestamp(x / 1e3).strftime("%B %d")

def friendly_month_year(x):
return datetime.strptime(x, "%Y-%m-%d").strftime("%B %Y")

def friendly_month_year_from_int(x):
return datetime.fromtimestamp(x / 1e3).strftime("%B %Y")
return datetime.utcfromtimestamp(x / 1e3).strftime("%B %Y")

def friendly_month_day_year_from_int(x):
return datetime.fromtimestamp(x / 1e3).strftime('%m-%d-%Y')
return datetime.utcfromtimestamp(x / 1e3).strftime('%m-%d-%Y')

def friendly_month_day_year_from_string(x):
return datetime.strptime(x, '%Y%m%d').strftime('%m-%d-%Y')
Expand Down Expand Up @@ -213,7 +213,7 @@ def fetch_report_data(report_dir):
if name == 'feed_info':
report_data[name] = dict(report_data[name][0])
report_data[name]['date_month_year'] = friendly_month_year_from_int(
report_data[name]['publish_date'])
report_data[name]['report_start_date'])
report_data[name]['date_month'] = friendly_month_from_int(report_data[name]["publish_date"])
report_data[name]["start_month_day"] = friendly_month_day_from_int(
report_data[name]["report_start_date"])
Expand Down

0 comments on commit 8347e89

Please sign in to comment.