@propriety/court-calendar 1.0.53 → 1.0.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3,7 +3,7 @@ export default function CalendarList({ filteredDates, setSelectedDate, currentDa
|
|
|
3
3
|
filteredDates: CourtDate[];
|
|
4
4
|
setSelectedDate: (date: CourtDate) => void;
|
|
5
5
|
currentDate: Date;
|
|
6
|
-
onUpdateChair?: (courtDateId: number, position:
|
|
6
|
+
onUpdateChair?: (courtDateId: number, position: "first" | "second", userId: number | null) => void;
|
|
7
7
|
allCases: Record<string, Case[]>;
|
|
8
8
|
isPrinting?: boolean;
|
|
9
9
|
}): import("react/jsx-runtime").JSX.Element;
|
package/dist/index.mjs
CHANGED
|
@@ -14455,7 +14455,7 @@ function dD({
|
|
|
14455
14455
|
let T = !0, z = !0;
|
|
14456
14456
|
for (const q of N)
|
|
14457
14457
|
T && !si(q, Nn(k.MuniCode)) && (T = !1), z && q.DateCompleted === null && (z = !1);
|
|
14458
|
-
return
|
|
14458
|
+
return N.length > 0 && T ? "Settled/Decision" : z ? k.Lifecycle === Wt.UPLOADED ? "NYSCEF Uploaded" : y(k) ? "Adjourned (No Date)" : k.Lifecycle === Wt.ADJOURNED ? "Adjourned" : k.Lifecycle === Wt.SCHEDULED || k.Lifecycle === Wt.ASSIGNED ? "Scheduled" : "Blank" : "Reviewing";
|
|
14459
14459
|
}
|
|
14460
14460
|
function E(k) {
|
|
14461
14461
|
return k.Type === lt.IN_PERSON ? "In Person" : k.Type === lt.UNKNOWN ? "Unknown" : "Virtual";
|
|
@@ -14572,7 +14572,11 @@ function dD({
|
|
|
14572
14572
|
{
|
|
14573
14573
|
user1ID: N.user1ID,
|
|
14574
14574
|
user2ID: N.user2ID,
|
|
14575
|
-
onUpdateChair: r ? (T, z) => r(
|
|
14575
|
+
onUpdateChair: r ? (T, z) => r(
|
|
14576
|
+
N.courtDateId,
|
|
14577
|
+
T,
|
|
14578
|
+
z
|
|
14579
|
+
) : void 0
|
|
14576
14580
|
}
|
|
14577
14581
|
);
|
|
14578
14582
|
}
|
|
@@ -14622,7 +14626,11 @@ function dD({
|
|
|
14622
14626
|
numCases: k.CourtCases,
|
|
14623
14627
|
courtDate: k.CourtDate,
|
|
14624
14628
|
status: v(k),
|
|
14625
|
-
assigned: {
|
|
14629
|
+
assigned: {
|
|
14630
|
+
user1ID: k.FirstChair,
|
|
14631
|
+
user2ID: k.SecondChair,
|
|
14632
|
+
courtDateId: k.CourtDateID
|
|
14633
|
+
},
|
|
14626
14634
|
uploadDeadline: k.UploadDeadline,
|
|
14627
14635
|
location: E(k)
|
|
14628
14636
|
}, z = [];
|
|
@@ -14634,7 +14642,8 @@ function dD({
|
|
|
14634
14642
|
$.set(Q, [...$.get(Q) || [], J]);
|
|
14635
14643
|
}
|
|
14636
14644
|
for (const [J, Y] of $) {
|
|
14637
|
-
if (x.has(`${k.MuniCode}-${J}`))
|
|
14645
|
+
if (x.has(`${k.MuniCode}-${J}`))
|
|
14646
|
+
continue;
|
|
14638
14647
|
const [Q, be, Me] = J.split("-").map(Number);
|
|
14639
14648
|
z.push({
|
|
14640
14649
|
...T,
|
|
@@ -14669,7 +14678,12 @@ function dD({
|
|
|
14669
14678
|
}
|
|
14670
14679
|
},
|
|
14671
14680
|
onRowClick: (k) => {
|
|
14672
|
-
const N = parseInt(
|
|
14681
|
+
const N = parseInt(
|
|
14682
|
+
k.id.toString().split("-")[0],
|
|
14683
|
+
10
|
|
14684
|
+
), T = t.find(
|
|
14685
|
+
(z) => z.CourtDateID === N
|
|
14686
|
+
);
|
|
14673
14687
|
T && e(T);
|
|
14674
14688
|
},
|
|
14675
14689
|
getRowClassName: () => "ccalendar-list-row"
|
|
@@ -17981,7 +17995,7 @@ function ED({
|
|
|
17981
17995
|
start: (() => {
|
|
17982
17996
|
const [ae, Z, de] = be.split("-").map(Number), ve = new Date(ae, Z - 1, de);
|
|
17983
17997
|
if (q.HearingTime) {
|
|
17984
|
-
const [Te, Ee] = q.HearingTime.split(":").map(Number);
|
|
17998
|
+
const [Te, Ee] = q.HearingTime.replace(/\s*(AM|PM)$/i, "").split(":").map(Number);
|
|
17985
17999
|
ve.setHours(Te, Ee, 0, 0);
|
|
17986
18000
|
}
|
|
17987
18001
|
return ve;
|
|
@@ -18009,7 +18023,7 @@ function ED({
|
|
|
18009
18023
|
return z.length > 0 && z.every((J) => si(J, q)) ? [] : T.MultipleDates.filter(Boolean).map((J, Y) => {
|
|
18010
18024
|
const Q = new Date(J);
|
|
18011
18025
|
if (T.HearingTime) {
|
|
18012
|
-
const [be, Me] = T.HearingTime.split(":").map(Number);
|
|
18026
|
+
const [be, Me] = T.HearingTime.replace(/\s*(AM|PM)$/i, "").split(":").map(Number);
|
|
18013
18027
|
Q.setHours(be, Me, 0, 0);
|
|
18014
18028
|
}
|
|
18015
18029
|
return {
|
package/package.json
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import { useReferenceData } from
|
|
2
|
-
import { useFilter } from
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { useReferenceData } from "@/context/ReferenceDataContext";
|
|
2
|
+
import { useFilter } from "@/context/FilterContext";
|
|
3
|
+
import {
|
|
4
|
+
DateType,
|
|
5
|
+
HearingType,
|
|
6
|
+
Lifecycle,
|
|
7
|
+
type Case,
|
|
8
|
+
type CourtDate,
|
|
9
|
+
} from "@/types";
|
|
10
|
+
import { DataGrid, type GridColDef } from "@mui/x-data-grid";
|
|
11
|
+
import FirstSecondChairIcons from "../Shared/FirstSecondChairIcons";
|
|
12
|
+
import { isCaseSettled } from "@/helpers/cases";
|
|
13
|
+
import { isVillageDate, caseKey } from "@/helpers/courtDates";
|
|
8
14
|
|
|
9
15
|
export default function CalendarList({
|
|
10
16
|
filteredDates,
|
|
@@ -17,49 +23,56 @@ export default function CalendarList({
|
|
|
17
23
|
filteredDates: CourtDate[];
|
|
18
24
|
setSelectedDate: (date: CourtDate) => void;
|
|
19
25
|
currentDate: Date;
|
|
20
|
-
onUpdateChair?: (
|
|
26
|
+
onUpdateChair?: (
|
|
27
|
+
courtDateId: number,
|
|
28
|
+
position: "first" | "second",
|
|
29
|
+
userId: number | null,
|
|
30
|
+
) => void;
|
|
21
31
|
allCases: Record<string, Case[]>;
|
|
22
32
|
isPrinting?: boolean;
|
|
23
33
|
}) {
|
|
24
34
|
const { getTownshipName, getCountyName } = useReferenceData();
|
|
25
35
|
const { filterCtx } = useFilter();
|
|
26
36
|
const countyColors: Record<string, string> = {
|
|
27
|
-
Blank:
|
|
28
|
-
Suffolk:
|
|
29
|
-
Sullivan:
|
|
30
|
-
Westchester:
|
|
31
|
-
Ulster:
|
|
32
|
-
Columbia:
|
|
33
|
-
Rockland:
|
|
34
|
-
Putnam:
|
|
35
|
-
Nassau:
|
|
36
|
-
Greene:
|
|
37
|
-
Dutchess:
|
|
38
|
-
Orange:
|
|
39
|
-
Delaware:
|
|
37
|
+
Blank: "#c4c4c4",
|
|
38
|
+
Suffolk: "#faa1f1",
|
|
39
|
+
Sullivan: "#00c875",
|
|
40
|
+
Westchester: "#df2f4a",
|
|
41
|
+
Ulster: "#225091",
|
|
42
|
+
Columbia: "#9d50dd",
|
|
43
|
+
Rockland: "#037f4c",
|
|
44
|
+
Putnam: "#579bfc",
|
|
45
|
+
Nassau: "#cab641",
|
|
46
|
+
Greene: "#9cd326",
|
|
47
|
+
Dutchess: "#ffcb00",
|
|
48
|
+
Orange: "#ff6d3b",
|
|
49
|
+
Delaware: "#bb3354",
|
|
40
50
|
};
|
|
41
51
|
|
|
42
52
|
const typeColors: Record<string, string> = {
|
|
43
|
-
|
|
44
|
-
Negotiations:
|
|
53
|
+
"Court Dates": "#216edf",
|
|
54
|
+
Negotiations: "#33d391",
|
|
45
55
|
};
|
|
46
56
|
|
|
47
57
|
const statusColors: Record<string, string> = {
|
|
48
|
-
Blank:
|
|
49
|
-
Reviewing:
|
|
50
|
-
Scheduled:
|
|
51
|
-
|
|
52
|
-
Adjourned:
|
|
53
|
-
|
|
54
|
-
|
|
58
|
+
Blank: "#c4c4c4", // default
|
|
59
|
+
Reviewing: "#fdab3d", // dateCompleted not set
|
|
60
|
+
Scheduled: "#216edf", // Lifecycle.SCHEDULED or Lifecycle.ASSIGNED
|
|
61
|
+
"NYSCEF Uploaded": "#037f4c", // Status.UPLOADED
|
|
62
|
+
Adjourned: "#faa1f1", // isAdjourned true
|
|
63
|
+
"Adjourned (No Date)": "rgb(151, 11, 134)", // OA cases with no specific adjournment date
|
|
64
|
+
"Settled/Decision": "#df2f4a", // isCaseSettled true
|
|
55
65
|
};
|
|
56
66
|
|
|
57
67
|
function hasOACases(date: CourtDate): boolean {
|
|
58
68
|
const isVillage = isVillageDate(date.MuniCode);
|
|
59
|
-
const isOA = (det: string) => (det ||
|
|
60
|
-
return (allCases[caseKey(date)] || []).some(
|
|
61
|
-
|
|
62
|
-
|
|
69
|
+
const isOA = (det: string) => (det || "").toLowerCase() === "oa";
|
|
70
|
+
return (allCases[caseKey(date)] || []).some(
|
|
71
|
+
(c) =>
|
|
72
|
+
!c.AdjournedDate &&
|
|
73
|
+
(isVillage
|
|
74
|
+
? isOA(c.VillageSCARDeterminationAction)
|
|
75
|
+
: isOA(c.SCARDeterminationAction)),
|
|
63
76
|
);
|
|
64
77
|
}
|
|
65
78
|
|
|
@@ -68,7 +81,10 @@ export default function CalendarList({
|
|
|
68
81
|
let allSettled = true;
|
|
69
82
|
let allReviewed = true;
|
|
70
83
|
for (const caseItem of cases) {
|
|
71
|
-
if (
|
|
84
|
+
if (
|
|
85
|
+
allSettled &&
|
|
86
|
+
!isCaseSettled(caseItem, isVillageDate(date.MuniCode))
|
|
87
|
+
) {
|
|
72
88
|
allSettled = false;
|
|
73
89
|
}
|
|
74
90
|
if (allReviewed && caseItem.DateCompleted === null) {
|
|
@@ -76,51 +92,55 @@ export default function CalendarList({
|
|
|
76
92
|
}
|
|
77
93
|
}
|
|
78
94
|
|
|
79
|
-
if (
|
|
80
|
-
if (
|
|
81
|
-
if (date.Lifecycle === Lifecycle.UPLOADED) return
|
|
82
|
-
if (hasOACases(date)) return
|
|
83
|
-
if (date.Lifecycle === Lifecycle.ADJOURNED) return
|
|
84
|
-
if (
|
|
95
|
+
if (cases.length > 0 && allSettled) return "Settled/Decision";
|
|
96
|
+
if (!allReviewed) return "Reviewing";
|
|
97
|
+
if (date.Lifecycle === Lifecycle.UPLOADED) return "NYSCEF Uploaded";
|
|
98
|
+
if (hasOACases(date)) return "Adjourned (No Date)";
|
|
99
|
+
if (date.Lifecycle === Lifecycle.ADJOURNED) return "Adjourned";
|
|
100
|
+
if (
|
|
101
|
+
date.Lifecycle === Lifecycle.SCHEDULED ||
|
|
102
|
+
date.Lifecycle === Lifecycle.ASSIGNED
|
|
103
|
+
)
|
|
104
|
+
return "Scheduled";
|
|
85
105
|
|
|
86
|
-
return
|
|
106
|
+
return "Blank";
|
|
87
107
|
}
|
|
88
108
|
|
|
89
109
|
function determineLocation(date: CourtDate): string {
|
|
90
|
-
if (date.Type === HearingType.IN_PERSON) return
|
|
91
|
-
if (date.Type === HearingType.UNKNOWN) return
|
|
92
|
-
return
|
|
110
|
+
if (date.Type === HearingType.IN_PERSON) return "In Person";
|
|
111
|
+
if (date.Type === HearingType.UNKNOWN) return "Unknown";
|
|
112
|
+
return "Virtual";
|
|
93
113
|
}
|
|
94
114
|
|
|
95
115
|
const locationColors: Record<string, string> = {
|
|
96
|
-
Virtual:
|
|
97
|
-
|
|
98
|
-
Unknown:
|
|
116
|
+
Virtual: "var(--fc-event-virtual-color)",
|
|
117
|
+
"In Person": "var(--fc-event-inperson-color)",
|
|
118
|
+
Unknown: "var(--fc-event-unknown-color)",
|
|
99
119
|
};
|
|
100
120
|
|
|
101
121
|
const columns: GridColDef[] = [
|
|
102
122
|
{
|
|
103
|
-
field:
|
|
104
|
-
headerName:
|
|
123
|
+
field: "township",
|
|
124
|
+
headerName: "Municipality",
|
|
105
125
|
width: 150,
|
|
106
126
|
disableColumnMenu: true,
|
|
107
127
|
},
|
|
108
128
|
{
|
|
109
|
-
field:
|
|
110
|
-
headerName:
|
|
129
|
+
field: "county",
|
|
130
|
+
headerName: "County",
|
|
111
131
|
width: 125,
|
|
112
132
|
disableColumnMenu: true,
|
|
113
133
|
renderCell: (params) => {
|
|
114
134
|
const county = params.value as string;
|
|
115
|
-
const color = countyColors[county] ||
|
|
135
|
+
const color = countyColors[county] || "#c4c4c4";
|
|
116
136
|
return (
|
|
117
137
|
<span
|
|
118
138
|
style={{
|
|
119
139
|
backgroundColor: color,
|
|
120
|
-
color:
|
|
121
|
-
padding:
|
|
122
|
-
borderRadius:
|
|
123
|
-
fontWeight:
|
|
140
|
+
color: "#fff",
|
|
141
|
+
padding: "4px 8px",
|
|
142
|
+
borderRadius: "4px",
|
|
143
|
+
fontWeight: "bold",
|
|
124
144
|
border: `1px solid`,
|
|
125
145
|
}}
|
|
126
146
|
>
|
|
@@ -130,21 +150,21 @@ export default function CalendarList({
|
|
|
130
150
|
},
|
|
131
151
|
},
|
|
132
152
|
{
|
|
133
|
-
field:
|
|
134
|
-
headerName:
|
|
153
|
+
field: "type",
|
|
154
|
+
headerName: "Type",
|
|
135
155
|
width: 125,
|
|
136
156
|
disableColumnMenu: true,
|
|
137
157
|
renderCell: (params) => {
|
|
138
158
|
const type = params.value as string;
|
|
139
|
-
const color = typeColors[type] ||
|
|
159
|
+
const color = typeColors[type] || "#c4c4c4";
|
|
140
160
|
return (
|
|
141
161
|
<span
|
|
142
162
|
style={{
|
|
143
163
|
backgroundColor: color,
|
|
144
|
-
color:
|
|
145
|
-
padding:
|
|
146
|
-
borderRadius:
|
|
147
|
-
fontWeight:
|
|
164
|
+
color: "#fff",
|
|
165
|
+
padding: "4px 8px",
|
|
166
|
+
borderRadius: "4px",
|
|
167
|
+
fontWeight: "bold",
|
|
148
168
|
border: `1px solid`,
|
|
149
169
|
}}
|
|
150
170
|
>
|
|
@@ -154,44 +174,45 @@ export default function CalendarList({
|
|
|
154
174
|
},
|
|
155
175
|
},
|
|
156
176
|
{
|
|
157
|
-
field:
|
|
158
|
-
headerName:
|
|
177
|
+
field: "district",
|
|
178
|
+
headerName: "District",
|
|
159
179
|
width: 75,
|
|
160
180
|
disableColumnMenu: true,
|
|
161
181
|
},
|
|
162
182
|
{
|
|
163
|
-
field:
|
|
164
|
-
headerName:
|
|
183
|
+
field: "numCases",
|
|
184
|
+
headerName: "# Cases",
|
|
165
185
|
width: 75,
|
|
166
186
|
disableColumnMenu: true,
|
|
167
187
|
},
|
|
168
188
|
{
|
|
169
|
-
field:
|
|
170
|
-
headerName:
|
|
189
|
+
field: "courtDate",
|
|
190
|
+
headerName: "Court Date",
|
|
171
191
|
width: 125,
|
|
172
192
|
disableColumnMenu: true,
|
|
173
193
|
valueFormatter: (params: Date) => {
|
|
174
194
|
const date = new Date(params);
|
|
175
195
|
return date.toLocaleDateString();
|
|
176
196
|
},
|
|
177
|
-
sortComparator: (v1, v2) =>
|
|
197
|
+
sortComparator: (v1, v2) =>
|
|
198
|
+
new Date(v1).getTime() - new Date(v2).getTime(),
|
|
178
199
|
},
|
|
179
200
|
{
|
|
180
|
-
field:
|
|
181
|
-
headerName:
|
|
201
|
+
field: "status",
|
|
202
|
+
headerName: "Status",
|
|
182
203
|
width: 150,
|
|
183
204
|
disableColumnMenu: true,
|
|
184
205
|
renderCell: (params) => {
|
|
185
206
|
const status = params.value as string;
|
|
186
|
-
const color = statusColors[status] ||
|
|
207
|
+
const color = statusColors[status] || "#c4c4c4";
|
|
187
208
|
return (
|
|
188
209
|
<span
|
|
189
210
|
style={{
|
|
190
211
|
backgroundColor: color,
|
|
191
|
-
color:
|
|
192
|
-
padding:
|
|
193
|
-
borderRadius:
|
|
194
|
-
fontWeight:
|
|
212
|
+
color: "#fff",
|
|
213
|
+
padding: "4px 8px",
|
|
214
|
+
borderRadius: "4px",
|
|
215
|
+
fontWeight: "bold",
|
|
195
216
|
border: `1px solid`,
|
|
196
217
|
}}
|
|
197
218
|
>
|
|
@@ -201,8 +222,8 @@ export default function CalendarList({
|
|
|
201
222
|
},
|
|
202
223
|
},
|
|
203
224
|
{
|
|
204
|
-
field:
|
|
205
|
-
headerName:
|
|
225
|
+
field: "assigned",
|
|
226
|
+
headerName: "Assigned",
|
|
206
227
|
width: 125,
|
|
207
228
|
disableColumnMenu: true,
|
|
208
229
|
renderCell: (params) => {
|
|
@@ -217,7 +238,12 @@ export default function CalendarList({
|
|
|
217
238
|
user2ID={assigned.user2ID}
|
|
218
239
|
onUpdateChair={
|
|
219
240
|
onUpdateChair
|
|
220
|
-
? (position, userId) =>
|
|
241
|
+
? (position, userId) =>
|
|
242
|
+
onUpdateChair(
|
|
243
|
+
assigned.courtDateId,
|
|
244
|
+
position,
|
|
245
|
+
userId,
|
|
246
|
+
)
|
|
221
247
|
: undefined
|
|
222
248
|
}
|
|
223
249
|
/>
|
|
@@ -225,8 +251,8 @@ export default function CalendarList({
|
|
|
225
251
|
},
|
|
226
252
|
},
|
|
227
253
|
{
|
|
228
|
-
field:
|
|
229
|
-
headerName:
|
|
254
|
+
field: "uploadDeadline",
|
|
255
|
+
headerName: "Upload Deadline",
|
|
230
256
|
width: 125,
|
|
231
257
|
disableColumnMenu: true,
|
|
232
258
|
valueFormatter: (params: Date) => {
|
|
@@ -235,21 +261,21 @@ export default function CalendarList({
|
|
|
235
261
|
},
|
|
236
262
|
},
|
|
237
263
|
{
|
|
238
|
-
field:
|
|
239
|
-
headerName:
|
|
264
|
+
field: "location",
|
|
265
|
+
headerName: "Location",
|
|
240
266
|
width: 125,
|
|
241
267
|
disableColumnMenu: true,
|
|
242
268
|
renderCell: (params) => {
|
|
243
269
|
const location = params.value as string;
|
|
244
|
-
const color = locationColors[location] ||
|
|
270
|
+
const color = locationColors[location] || "#c4c4c4";
|
|
245
271
|
return (
|
|
246
272
|
<span
|
|
247
273
|
style={{
|
|
248
274
|
backgroundColor: color,
|
|
249
|
-
color:
|
|
250
|
-
padding:
|
|
251
|
-
borderRadius:
|
|
252
|
-
fontWeight:
|
|
275
|
+
color: "#fff",
|
|
276
|
+
padding: "4px 8px",
|
|
277
|
+
borderRadius: "4px",
|
|
278
|
+
fontWeight: "bold",
|
|
253
279
|
border: `1px solid`,
|
|
254
280
|
}}
|
|
255
281
|
>
|
|
@@ -265,7 +291,7 @@ export default function CalendarList({
|
|
|
265
291
|
.filter((d) => d.CourtDate)
|
|
266
292
|
.map((d) => {
|
|
267
293
|
const dt = new Date(d.CourtDate!);
|
|
268
|
-
return `${d.MuniCode}-${dt.getFullYear()}-${String(dt.getMonth() + 1).padStart(2,
|
|
294
|
+
return `${d.MuniCode}-${dt.getFullYear()}-${String(dt.getMonth() + 1).padStart(2, "0")}-${String(dt.getDate()).padStart(2, "0")}`;
|
|
269
295
|
}),
|
|
270
296
|
);
|
|
271
297
|
|
|
@@ -276,74 +302,91 @@ export default function CalendarList({
|
|
|
276
302
|
return courtDate.getFullYear() === currentDate.getFullYear();
|
|
277
303
|
})
|
|
278
304
|
.flatMap((date) => {
|
|
279
|
-
const hasMultiple =
|
|
305
|
+
const hasMultiple =
|
|
306
|
+
Array.isArray(date.MultipleDates) &&
|
|
307
|
+
date.MultipleDates.length > 0;
|
|
280
308
|
const baseRow = {
|
|
281
309
|
id: `${date.CourtDateID}`,
|
|
282
|
-
township: `${getTownshipName(date.MuniCode)}${hasMultiple ?
|
|
310
|
+
township: `${getTownshipName(date.MuniCode)}${hasMultiple ? " (day 1)" : ""}`,
|
|
283
311
|
county: getCountyName(date.MuniCode),
|
|
284
|
-
type:
|
|
312
|
+
type:
|
|
313
|
+
date.DateType === DateType.NEGOTIATIONS
|
|
314
|
+
? "Negotiations"
|
|
315
|
+
: "Court Dates",
|
|
285
316
|
district: date.MuniCode,
|
|
286
317
|
numCases: date.CourtCases,
|
|
287
318
|
courtDate: date.CourtDate,
|
|
288
319
|
status: determineStatus(date),
|
|
289
|
-
assigned: {
|
|
320
|
+
assigned: {
|
|
321
|
+
user1ID: date.FirstChair,
|
|
322
|
+
user2ID: date.SecondChair,
|
|
323
|
+
courtDateId: date.CourtDateID,
|
|
324
|
+
},
|
|
290
325
|
uploadDeadline: date.UploadDeadline,
|
|
291
326
|
location: determineLocation(date),
|
|
292
327
|
};
|
|
293
|
-
const adjRows: typeof baseRow[] = [];
|
|
328
|
+
const adjRows: (typeof baseRow)[] = [];
|
|
294
329
|
if (filterCtx.showAdjournmentDates) {
|
|
295
330
|
const buckets = new Map<string, Case[]>();
|
|
296
331
|
for (const c of allCases[caseKey(date)] || []) {
|
|
297
332
|
if (!c.AdjournedDate) continue;
|
|
298
333
|
const d = new Date(c.AdjournedDate);
|
|
299
|
-
const key = `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2,
|
|
334
|
+
const key = `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, "0")}-${String(d.getDate()).padStart(2, "0")}`;
|
|
300
335
|
buckets.set(key, [...(buckets.get(key) || []), c]);
|
|
301
336
|
}
|
|
302
337
|
for (const [key, adjCases] of buckets) {
|
|
303
|
-
if (realCourtDateKeys.has(`${date.MuniCode}-${key}`))
|
|
304
|
-
|
|
338
|
+
if (realCourtDateKeys.has(`${date.MuniCode}-${key}`))
|
|
339
|
+
continue;
|
|
340
|
+
const [y, m, d] = key.split("-").map(Number);
|
|
305
341
|
adjRows.push({
|
|
306
342
|
...baseRow,
|
|
307
343
|
id: `${date.CourtDateID}-adj-${key}`,
|
|
308
344
|
township: `${getTownshipName(date.MuniCode)} (${date.MuniCode}) - Adjournment`,
|
|
309
345
|
numCases: adjCases.length,
|
|
310
346
|
courtDate: new Date(y, m - 1, d),
|
|
311
|
-
status:
|
|
347
|
+
status: "Adjourned",
|
|
312
348
|
});
|
|
313
349
|
}
|
|
314
350
|
}
|
|
315
351
|
|
|
316
352
|
if (!hasMultiple) return [baseRow, ...adjRows];
|
|
317
|
-
const extraRows = date
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
353
|
+
const extraRows = date
|
|
354
|
+
.MultipleDates!.filter(Boolean)
|
|
355
|
+
.map((extraDate, index) => ({
|
|
356
|
+
...baseRow,
|
|
357
|
+
id: `${date.CourtDateID}-extra-${index}`,
|
|
358
|
+
township: `${getTownshipName(date.MuniCode)} (day ${index + 2})`,
|
|
359
|
+
courtDate: extraDate,
|
|
360
|
+
}));
|
|
323
361
|
return [baseRow, ...adjRows, ...extraRows];
|
|
324
362
|
});
|
|
325
363
|
|
|
326
364
|
return (
|
|
327
|
-
<div style={{ height: isPrinting ?
|
|
365
|
+
<div style={{ height: isPrinting ? "auto" : 600, width: "100%" }}>
|
|
328
366
|
<DataGrid
|
|
329
367
|
rows={rows}
|
|
330
368
|
columns={columns}
|
|
331
|
-
className=
|
|
369
|
+
className="themed"
|
|
332
370
|
autoHeight={isPrinting}
|
|
333
371
|
hideFooter={isPrinting}
|
|
334
372
|
initialState={{
|
|
335
373
|
sorting: {
|
|
336
|
-
sortModel: [{ field:
|
|
374
|
+
sortModel: [{ field: "courtDate", sort: "asc" }],
|
|
337
375
|
},
|
|
338
376
|
}}
|
|
339
377
|
onRowClick={(params) => {
|
|
340
|
-
const courtDateId = parseInt(
|
|
341
|
-
|
|
378
|
+
const courtDateId = parseInt(
|
|
379
|
+
params.id.toString().split("-")[0],
|
|
380
|
+
10,
|
|
381
|
+
);
|
|
382
|
+
const selected = filteredDates.find(
|
|
383
|
+
(date) => date.CourtDateID === courtDateId,
|
|
384
|
+
);
|
|
342
385
|
if (selected) {
|
|
343
386
|
setSelectedDate(selected);
|
|
344
387
|
}
|
|
345
388
|
}}
|
|
346
|
-
getRowClassName={() =>
|
|
389
|
+
getRowClassName={() => "ccalendar-list-row"}
|
|
347
390
|
/>
|
|
348
391
|
</div>
|
|
349
392
|
);
|
|
@@ -245,7 +245,7 @@ export function useCalendarEvents({
|
|
|
245
245
|
const [y, m, d] = key.split('-').map(Number);
|
|
246
246
|
const adjStart = new Date(y, m - 1, d);
|
|
247
247
|
if (date.HearingTime) {
|
|
248
|
-
const [h, min] = date.HearingTime.split(':').map(Number);
|
|
248
|
+
const [h, min] = date.HearingTime.replace(/\s*(AM|PM)$/i, '').split(':').map(Number);
|
|
249
249
|
adjStart.setHours(h, min, 0, 0);
|
|
250
250
|
}
|
|
251
251
|
return adjStart;
|
|
@@ -281,7 +281,7 @@ export function useCalendarEvents({
|
|
|
281
281
|
return date.MultipleDates.filter(Boolean).map((extraDate, index) => {
|
|
282
282
|
const start = new Date(extraDate);
|
|
283
283
|
if (date.HearingTime) {
|
|
284
|
-
const [h, m] = date.HearingTime.split(':').map(Number);
|
|
284
|
+
const [h, m] = date.HearingTime.replace(/\s*(AM|PM)$/i, '').split(':').map(Number);
|
|
285
285
|
start.setHours(h, m, 0, 0);
|
|
286
286
|
}
|
|
287
287
|
return {
|