generated from mission-apprentissage/template-apprentissage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from mission-apprentissage/fix/erreur-sur-les-…
…dates fix: mise a jour du format de date
- Loading branch information
Showing
11 changed files
with
76 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
import { differenceInYears, parseISO } from "date-fns"; | ||
import { differenceInYears } from "date-fns"; | ||
import { CerfaForm } from "shared/helpers/cerfa/types/cerfa.types"; | ||
|
||
import { customParseISODate } from "../../utils/dates"; | ||
|
||
export const shouldShowSmc = ({ values }: CerfaForm) => { | ||
if (!values.contrat.dateFinContrat || !values.apprenti.dateNaissance) return false; | ||
const dateFinContrat = parseISO(values.contrat.dateFinContrat); | ||
const dateNaissance = parseISO(values.apprenti.dateNaissance); | ||
const dateFinContrat = customParseISODate(values.contrat.dateFinContrat); | ||
const dateNaissance = customParseISODate(values.apprenti.dateNaissance); | ||
|
||
return differenceInYears(dateFinContrat, dateNaissance) >= 21; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.