Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions plugin/FERC/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -1368,19 +1368,20 @@ def get_dates(modelXbrl):
report_year = year_match[1] if year_match is not None else None
report_period = period_match[1].upper() if period_match is not None else None

if not report_year or not report_period:
raise FERCRenderException(
'Cannot obtain a valid report year({year}) or report period({period}) from the XBRL document'.format(
year=report_year, period=report_period
)
)
month_day = {
'Q4': ('01-01', '12-31'),
'Q3': ('01-01', '09-30'),
'Q2': ('01-01', '06-30'),
'Q1': ('01-01', '03-31')
}

if not report_year or report_period not in month_day:
raise FERCRenderException(
'Cannot obtain a valid report year({year}) or report period({period}) from the XBRL document'.format(
year=report_year, period=report_period
)
)

return (
('current-start={}-{}'.format(report_year, '01-01')),
('current-end={}-{}'.format(report_year, month_day[report_period][1])),
Expand Down Expand Up @@ -2710,4 +2711,4 @@ def format_durhour(model_fact, *args, **kwargs):
'CntlrCmdLine.Xbrl.Loaded': cmdLineXbrlLoaded,
#'CntlrWinMain.Menu.Tools': fercMenuTools,
#'CntlrWinMain.Xbrl.Loaded': cmdLineXbrlLoaded,
}
}