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

DatePicker: fix error display on load #3833

Draft
wants to merge 2 commits into
base: v2-bridge
Choose a base branch
from

Conversation

DavidFyon
Copy link
Contributor

@DavidFyon DavidFyon commented Nov 8, 2024

Description

Fix #3830

Playground

<script setup lang="ts">

import { notAfterDate, notBeforeDate, required } from '@/main';
import DatePicker from '@/patterns/DatePicker/DatePicker.vue';
import { ref } from 'vue';

import { reactive } from 'vue';

const piece = reactive({
	dateRedaction: '',
	dateReception: '',
});
const date = ref('')

const isValid = ref(false);

const send = () => {
	if (isValid.value) {
		console.log('send');
	}
};
</script>

<template>
	<v-form ref="form" v-model="isValid" @submit.prevent="send">
	<DatePicker
		v-model="piece.dateRedaction"
		label="Date de rédaction (optionnel)"
		bg-color="white"
		outlined
		:rules="[
		notAfterDate(piece.dateReception || ''),
	]"
	/>
	<br>
	<DatePicker
		v-model="piece.dateReception"
		label="Date de réception"
		bg-color="white"
		outlined
		:rules="[
		required,
		notBeforeDate(piece.dateRedaction || ''),
	]"
	/>


	<DatePicker
		v-model="date"
		label="Date "
		outlined
		:rules="[
		required,
		notBeforeDate(piece.dateRedaction || ''),
	]"
	/>
		<v-btn type="submit">Submit</v-btn>
	</v-form>
</template>

<style lang="scss" scoped></style>

Type de changement

  • Correction de bug

Checklist

  • Ma Pull Request pointe vers la bonne branche
  • Mon code suit le style de code du projet
  • J'ai effectué une review de mon propre code
  • J'ai commenté mon code, en particulier dans les parties difficiles à comprendre
  • J'ai apporté les modifications correspondantes à la documentation
  • Mes modifications ne génèrent aucun nouveau warning
  • J'ai ajouté des tests qui prouvent que mon correctif est efficace ou que ma fonctionnalité fonctionne
  • Les tests unitaires passent localement avec mes modifications
  • J'ai mis à jour le fichier Changelog

@DavidFyon DavidFyon self-assigned this Nov 8, 2024
@DavidFyon DavidFyon changed the title fix error display DatePicker: fix error display on load Nov 8, 2024
@DavidFyon DavidFyon linked an issue Nov 8, 2024 that may be closed by this pull request
@VachetVirginie VachetVirginie marked this pull request as draft November 15, 2024 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DatePicker: Les messages d'erreur ne s'affiche pas lors du submit
1 participant