Closed PaulClark2 closed 6 years ago
This is a front end task. We calculate the time period depending on the 2-4-6 aspect of the data. I think we will want to start off the the calculation by getting the end year of the cycle with something like n = n + n % 2
House Candidate: Ossoff https://www.fec.gov/data/candidate/H8GA06195/
However, request seems to prefer the Time Period to be 2017-2018. @PaulClark2 should Time Period display Years based on coverage dates or Election year?
API Candidate Filings endpoint - returns Filings Coverage Start/End dates that are null see API Request: https://api.open.fec.gov/v1/candidate/H8GA06195/filings/?page=1&per_page=20&api_key=DEMO_KEY&sort=-receipt_date
API results: (FEC) Election Years | Candidate Election Years | Cycles election_years | candidate_election_year. | cycles | two_year_period 2017 | 2017 | 2018 | 2018 2017 | 2017 | 2018 | 2018
API testing below indicates that API returns 2017 for elections years and 2018 for cycles. API Testing: https://api.open.fec.gov/developers/#!/candidate/get_candidate_candidate_id_history_cycle
Same issues for House Candidate: Handel https://www.fec.gov/data/candidate/H8GA06286/
Webpage Election years should display as even years (this was resolved with issue#1644 / PR1708)
Time Period for Election This candidates's Time Period: 2016-2017 is including the Coverage Dates Webpage/ GUI Display Election | Time Period | Filings | Years | Years (Cycles) | Coverage Dates: | 2017 | 2016-2017 | 01/01/2017 to 09/30/2017 | However, request seems to prefer the Time Period to be 2017-2018.
API Filings Coverage Start/End dates are null API request: https://api.open.fec.gov/v1/candidate/H8GA06286/filings/?page=1&per_page=20&api_key=DEMO_KEY&sort=-receipt_date
Technical research: The Time Period is handled in the subcycle-select component (GUI template)
The Time Period sub cycle component is displayed using the Handlebars templates: electionCycle.hbs and electionCycles.hb The initCycles code in cycle-select.js is where the min and max cycle is determined. The code uses the selected cycle (assuming even year) to setup the min and max cycles For single cycle (house) setting max=selected and min= selected -1 This seems to be coded correctly when input cycle is correct end year.
This is working correctly now, once PR1708 (issue#1644) is released, correcting the issue with the odd value Election year changed to even Election year which ensures the input is the correct end year.
should be fixed in the next release with this merged PR https://github.com/18F/fec-cms/pull/1708
Closing this issue
What we’re after: We should display the correct two-year period (
Time period:
) for all candidates.Current state: The two-year period (
Time period:
) for House special election candidates is incorrect. TheTime period:
of odd-year special elections should be the election year plus one not election year minus one.Examples:
https://www.fec.gov/data/candidate/H8GA06195/
https://www.fec.gov/data/candidate/H8GA06286/
Screenshot:
Completion criteria:
Time period:
: front-end or API issue This was a front-end issueTime period:
This was resolved by PR1708/Issue#1644 Election Year correctionRelated issues or PRs: https://github.com/18F/fec-cms/issues/1644 https://github.com/18F/fec-cms/issues/1642 https://github.com/18F/fec-cms/pull/1677