From 680288454090f3c48c7f0580cdcb919c0b5a883e Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Tue, 23 Mar 2021 14:04:36 -0700 Subject: [PATCH] ensure period is always uppercase in dict value. update period documentation --- docs/parsers/date.md | 2 +- jc/parsers/date.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/parsers/date.md b/docs/parsers/date.md index 15b2f2fb..094932e0 100644 --- a/docs/parsers/date.md +++ b/docs/parsers/date.md @@ -82,7 +82,7 @@ Returns: "hour": integer, "minute": integer, "second": integer, - "period": string, + "period": string, # 'AM' or 'PM'. null if 24-hour output "month": string, "weekday": string, "weekday_num": integer, diff --git a/jc/parsers/date.py b/jc/parsers/date.py index d8950822..7e536802 100644 --- a/jc/parsers/date.py +++ b/jc/parsers/date.py @@ -88,7 +88,7 @@ def process(proc_data): "hour": integer, "minute": integer, "second": integer, - "period": string, + "period": string, # 'AM' or 'PM'. null if 24-hour output "month": string, "weekday": string, "weekday_num": integer, @@ -148,7 +148,7 @@ def process(proc_data): 'hour': dt_hour, 'minute': dt_minute, 'second': dt_second, - 'period': proc_data['period'] if 'period' in proc_data else None, + 'period': proc_data['period'].upper() if 'period' in proc_data else None, 'month': proc_data['month'], 'weekday': proc_data['weekday'], 'weekday_num': weekday_map[proc_data['weekday']],