adds french & fixes translation issues

This commit is contained in:
Christian Beutel
2024-03-28 14:34:48 +01:00
parent 340a3c7c05
commit 7662234ff4
15 changed files with 335 additions and 42 deletions

View File

@@ -1,5 +1,3 @@
import { parse } from "date-fns";
import { date, number, object, string } from "yup";
class SummitLog {
id?: string;
@@ -13,14 +11,5 @@ class SummitLog {
}
}
const summitLogSchema = object<SummitLog>({
id: string().optional(),
date: date().transform((value, originalValue, context) => {
if (context.isType(value)) return value;
return parse(originalValue, 'dd.MM.yyyy', new Date());
}).required('Required').typeError('Invalid Date'),
text: string().optional(),
});
export { SummitLog, summitLogSchema }
export { SummitLog };