feat(web): clear person birthdate (#18330)

This commit is contained in:
Jason Rasmussen
2025-05-16 11:56:25 -04:00
committed by GitHub
parent a9e7d0388b
commit 28d8357cc5
7 changed files with 190 additions and 101 deletions

View File

@@ -24,7 +24,7 @@
try {
const updatedPerson = await updatePerson({
id: person.id,
personUpdateDto: { birthDate: birthDate.length > 0 ? birthDate : null },
personUpdateDto: { birthDate },
});
notificationController.show({ message: $t('date_of_birth_saved'), type: NotificationType.Info });
@@ -53,6 +53,13 @@
bind:value={birthDate}
max={todayFormatted}
/>
{#if person.birthDate}
<div class="flex justify-end">
<Button shape="round" color="secondary" size="small" onclick={() => (birthDate = '')}>
{$t('clear')}
</Button>
</div>
{/if}
</div>
</form>
</ModalBody>
@@ -62,8 +69,8 @@
<Button shape="round" color="secondary" fullWidth onclick={() => onClose()}>
{$t('cancel')}
</Button>
<Button type="submit" shape="round" color="primary" fullWidth>
{$t('set')}
<Button type="submit" shape="round" color="primary" fullWidth form="set-birth-date-form">
{$t('save')}
</Button>
</div>
</ModalFooter>