Skip to content

Commit c8a36a9

Browse files
committed
Fixes
1 parent a2b0d90 commit c8a36a9

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

server/dates.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ def mock_get_dates(start_year, end_year, today, month_delta=0):
3838
current_month_in_year = "0{}".format(current_month_in_year)
3939

4040
months.append("{}_{}_01".format(year, current_month_in_year))
41-
if year == end_year and current_month_in_year == month_delta and today < 15:
42-
continue
43-
months.append("{}_{}_15".format(year, current_month_in_year))
4441

4542
if month % 12 == 0:
4643
year = year + 1

src/js/utils.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ const prettyShortDateFormatter = new Intl.DateTimeFormat(undefined, {
1515

1616
export const prettyDate = YYYY_MM_DD => {
1717
const [YYYY, MM, DD] = YYYY_MM_DD.split('_');
18-
const d = new Date(Date.UTC(YYYY, MM - 1, DD));
19-
const formattedDate = DD === '01' ?
20-
prettyShortDateFormatter.format(d) :
21-
prettyDateFormatter.format(d);
22-
return formattedDate;
18+
if (YYYY > '2018') {
19+
const d = new Date(Date.UTC(YYYY, MM - 1));
20+
return prettyShortDateFormatter.format(d);
21+
} else {
22+
const d = new Date(Date.UTC(YYYY, MM - 1, DD));
23+
return prettyDateFormatter.format(d);
24+
}
2325
};
2426

2527
export const getFullDate = d => {

0 commit comments

Comments
 (0)