Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add InputDatePicker type in inputTypes.ts #601

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions packages/evolution-generator/src/types/inputTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,3 +298,21 @@ export type InputMapFindPlace = InputMapFindPlaceBase & {

/* InfoMap widgetConfig Type */
export type InfoMap = InfoMapWidgetConfig;

/* InputDatePicker widgetConfig Type */
export type InputDatePicker = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Voir le InputDatePickerType dans WidgetConfig.ts. D'ailleurs il faudrait vraiment uniformiser les types entre le générateur et WidgetConfig, mais la façon dont ils sont décrits ne le permet pas efficacement actuellement, pour les questions du moins. Mais les types du WidgetConfig sont plus complets. Par exemple, pour locale, la clé est le code de langue et non fixé à 'fr', 'en' et les max/minDate peuvent aussi être une date hardcodée et pas qu'une fonction.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C'est bon. Il va falloir uniformiser cela dès que possible.

type: 'question';
inputType: 'datePicker';
path: Path;
label: Label;
datatype: 'number';
containsHtml: ContainsHtml;
twoColumns: TwoColumns;
showTimeSelect: boolean;
placeholderText: Title;
locale: { fr: string; en: string };
maxDate: (interview, path) => Date;
minDate: (interview, path) => Date;
conditional: Conditional;
validations: Validations;
};