From 0449df38f5427a356bca173ebf1065d0b99f76ad Mon Sep 17 00:00:00 2001 From: esteban Date: Sat, 1 Aug 2026 11:07:42 -0500 Subject: [PATCH] add tooltip for age and profesion, and message for show the conditions of minor age --- src/components/forms/DynamicForm.vue | 14 +++++++++++++- src/i18n/en.json | 5 ++++- src/i18n/es.json | 5 ++++- src/i18n/pt.json | 5 ++++- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/components/forms/DynamicForm.vue b/src/components/forms/DynamicForm.vue index d2a18d5..db66632 100644 --- a/src/components/forms/DynamicForm.vue +++ b/src/components/forms/DynamicForm.vue @@ -49,6 +49,13 @@ const fieldHelp = (key) => { return v !== k ? v : ""; }; +const isMinorBetween12and18 = (key) => { + const y = dateParts[key]?.year; + if (!y) return false; + const age = new Date().getFullYear() - y; + return age >= 12 && age < 18; +}; + const stepErrors = reactive({}); const formatErrors = reactive({}); const phoneParts = reactive({}); @@ -62,7 +69,7 @@ const months = [ const years = (() => { const y = new Date().getFullYear(); - return Array.from({ length: 101 }, (_, i) => y - i); + return Array.from({ length: 101 }, (_, i) => y - 12 - i); })(); const remainingRequired = computed(() => { @@ -713,6 +720,11 @@ const getFieldInputType = (field) => { +
+ + {{ tl("form.fecha_nacimiento_menor_aviso") }} +
+