3 Commits

Author SHA1 Message Date
df7600f959 Merge branch 'master' of ssh://gitea.communiquons.org:52001/pierre/GeneIT
All checks were successful
continuous-integration/drone/push Build is passing
2023-08-26 08:04:26 +02:00
b5dc78a8e1 Do not display full dates if day and month are unknown 2023-08-26 08:04:02 +02:00
cf7ad598db Limit the number of choices in member input 2023-08-26 08:00:29 +02:00
2 changed files with 9 additions and 4 deletions

View File

@@ -176,6 +176,9 @@ export class Member implements MemberDataApi {
} }
export function fmtDate(d?: DateValue): string { export function fmtDate(d?: DateValue): string {
if (d?.year && !d.month && !d.day)
return d?.year?.toString().padStart(4, "0");
return `${d?.day?.toString().padStart(2, "0") ?? "__"}/${ return `${d?.day?.toString().padStart(2, "0") ?? "__"}/${
d?.month?.toString().padStart(2, "0") ?? "__" d?.month?.toString().padStart(2, "0") ?? "__"
}/${d?.year?.toString().padStart(4, "0") ?? "__"}`; }/${d?.year?.toString().padStart(4, "0") ?? "__"}`;

View File

@@ -65,11 +65,13 @@ export function MemberInput(p: {
}} }}
options={choices} options={choices}
sx={{ width: "100%" }} sx={{ width: "100%" }}
filterOptions={(options, state) => filterOptions={(options, state) => {
options.filter((m) => const res = options.filter((m) =>
m?.fullName.toLowerCase().includes(state.inputValue) m?.fullName.toLowerCase().includes(state.inputValue)
) );
} res.length = Math.min(20, res.length);
return res;
}}
getOptionLabel={(o) => o?.fullName ?? ""} getOptionLabel={(o) => o?.fullName ?? ""}
renderInput={(params) => <TextField {...params} label={p.label} />} renderInput={(params) => <TextField {...params} label={p.label} />}
renderOption={(_props, option, _state) => ( renderOption={(_props, option, _state) => (