California UD CourtDateCalculator - jurisgpt/GrizlyUDVacator GitHub Wiki
CourtDateCalculator: Use Cases and Implementation Framework
Introduction
Accurate calendaring of legal deadlines is critical for avoiding default judgments in California eviction proceedings. CourtDateCalculator provides Legal Aid attorneys with precise, explainable, reproducible computations of court-related deadlines, incorporating statutory rules, scientific rigor in date arithmetic, and mathematical clarity in counting algorithms. This article outlines three core use cases—filing deadlines for Unlawful Detainer answers, service of process deadlines under CCP § 1005 (including mail rules), and general court-day arithmetic—and details their legal, scientific, and mathematical underpinnings.
Background and Legal Framework
California law differentiates between calendar days (every day on the calendar) and court days (days the court is open for business). Key statutes:
-
CCP § 12c: "The day of the act, event, or default after which the designated period of time begins to run is not included."
-
CCP § 12a: "If the last day for the performance of any act ... is a holiday, then that period is extended to and including the next day that is not a holiday."
-
CCP § 135 & § 12b: Define state court holidays in California.
-
CCP § 1005: Mandates that motions be served and filed at least 16 court days before the hearing; adds five calendar days for mail service within California.
Scientific & Mathematical Foundations:
-
Date Arithmetic: Employs modular arithmetic for month/year rollovers (including leap years).
-
Set Theory: Constructs the date set and filters via weekend/holiday predicates.
-
Algorithmic Complexity: Linear time in the number of dates spanned; constant-time checks for weekends and holidays.
Use Case 1: Filing Deadline for UD Answer (MVP Focus)
Legal Requirements
-
Statute: Under CCP § 116.310, a tenant must file an answer within 10 court days after service in an Unlawful Detainer action.
-
Exclusion: Service date (Day 0) is excluded per CCP § 12c.
-
Extension: If Day 10 falls on a non-court day, the deadline extends per CCP § 12a.
Scientific & Mathematical Approach
-
Start Date: (service date).
-
Offset: court days.
-
Iteration: Increment day-by-day; count only if not weekend or holiday.
-
Push‑Forward: If the resulting date is not a court day, advance to the next court day.
Output:
- Deadline Date
- Total Calendar Days spanned
- Total Court Days Counted
- Audit Trail of each date's classification.
Use Case 2: Service Deadline for Motions under CCP § 1005
Legal Requirements
-
Statute: CCP § 1005(b) requires service and filing 16 court days before a hearing.
-
Mail Extension: CCP § 1005(a) grants an additional 5 calendar days for mail service within California.
-
Holiday Handling: Apply CCP § 12a after both the 16-day and 5-day calculations.
Scientific & Mathematical Approach
-
Compute 16 court-day count backward from the hearing date.
-
Add 5 calendar days unconditionally.
-
Adjust per CCP § 12a if the final date is not a court day.
-
Audit: Two-phase tabular output showing both segments.
Implementation Sketch (ASP)
% Phase 1: 16 court-day backward count
decline_date(Y,M,D) :- alt_date_backward(H_y,H_m,H_d,16,Y,M,D), next_open_day(Y,M,D,Y1,M1,D1).
% Phase 2: 5 calendar-day extension
service_deadline(Yf,Mf,Df) :- decline_date(Y1,M1,D1), add_calendar_days(5,Y1,M1,D1,Y2,M2,D2), next_open_day(Y2,M2,D2,Yf,Mf,Df).
Use Case 3: General Court-Day Arithmetic
Legal Requirements & Flexibility
- Supports both forward and backward counting per CCP § 12c and applies CCP § 12a for push-forward adjustments.
Scientific & Mathematical Approach
-
Parameterize any integer (positive for forward, negative for backward).
-
Symmetry: Reuse the same counting logic for both directions.
-
Auditability: Return full date-by-date classifications.
Unified ASP Predicate
shift_court_days(Y0,M0,D0,N,Yf,Mf,Df) :-
(N>=0 -> alt_date_forward(Y0,M0,D0,N,Yt,Mt,Dt);
alt_date_backward(Y0,M0,D0,-N,Yt,Mt,Dt)),
next_open_day(Yt,Mt,Dt,Yf,Mf,Df).
Conclusion and Roadmap
CourtDateCalculator merges California statutory mandates, mathematically rigorous date algorithms, and transparent audit trails into a single declarative framework. The MVP will deliver Use Case 1 for Unlawful Detainer answer deadlines. Subsequent releases will layer Use Case 2 (CCP § 1005 service deadlines) and Use Case 3 (generic court-day arithmetic) to support a broad spectrum of calendaring needs for California Legal Aid practitioners.