Skip to main content

Calculation code comments Scrutiny start date for bicameral instruments with both Houses sitting

On GitHub: app/lib/calculations/bicameral_both_houses_sitting_reverse.rb

1 module Calculations
2   module BicameralBothHousesSittingReverse

Paragraph 1 of section 7 of the Statutory Instrument Act 1946 sets out that - in calculating the scrutiny period for an SI under that Act - “no account shall be taken of any time during which Parliament is dissolved or prorogued or during which both Houses are adjourned for more than four days.” This applies to the majority of made affirmative instruments.

Made affirmatives laid under different Acts follow other rules, for example: paragraph 9 of section 5 of the National Insurance Contributions Act 2014, sets out that “no account is to be taken of any time [..] during which either House is adjourned for more than 4 days."

This calculation deals with the case where days are not counted if either House is adjourned for more than four days.

The rules governing the time periods for Legislative Reform Orders are set out in sections 18 and 19 of the Legislative and Regulatory Reform Act 2006.

The rules governing the time period for Public Body Orders are set out in paragraph 12 of section 11 of the Public Bodies Act 2011.

The rules governing the time period for Localism Orders are set out in paragraph 14 of section 19 of the Localism Act 2011.

The rules governing the time period for published drafts are set out in paragraph 14 of schedule 8 of the European Union (Withdrawal) Act 2018.

The rules governing the time period for enhanced affirmatives under the Investigatory Powers Act 2016 are set out in paragraph 11 of section 268 of the Investigatory Powers Act 2016.

14     def bicameral_calculation_both_houses_sitting_reverse( date, target_day_count )

We set the scrutiny start date, being the start date of the calculation and the end date of the scrutiny period.

17       @scrutiny_start_date = nil

We go forward one day.

20       date = date.next

We set the day count to zero.

23       day_count = 0

Whilst the number of days we’re counting is less than the target number of days to count ...

26       while day_count < target_day_count

... we continue to the previous day.

29         date = date.prev_day

If the day is a scrutiny day in both Houses ...

32         if date.is_joint_scrutiny_day?

... we set the scrutiny start date to this date if the scrutiny start date is nil ...

35           @scrutiny_start_date = date if @scrutiny_start_date.nil?

... and add 1 to the day count.

38           day_count += 1

Otherwise, if the calendar has no record of what type of day this is, we can't calculate the end date, ...

41         elsif date.is_calendar_not_populated?

... this error message is displayed to users ...

44           @error_message = "It's not currently possible to calculate an anticipated start date, as that date occurs during a period for which no sitting day information is available."

... and we stop looking through the calendar.

47           break
48         end
49       end

Return the anticipated start date of the scrutiny period for display.

52       date
53     end
54   end
55 end