Can update exception ignore field

This commit is contained in:
nemunaire 2022-12-15 18:40:50 +01:00
parent 51a52fcb8e
commit 45efc3601e
2 changed files with 9 additions and 5 deletions

View File

@ -12,8 +12,10 @@ export class AlarmRepeated {
this.routines = routines == null ? [] : routines;
this.ignore_exceptions = ignore_exceptions;
this.comment = comment;
this.excepts = excepts;
this.next_time = next_time;
if (excepts !== undefined)
this.excepts = excepts;
if (next_time !== undefined)
this.next_time = next_time;
if (this.routines.length < 1) {
this.routines.push("");

View File

@ -4,6 +4,7 @@
Col,
Container,
Icon,
Input,
ListGroup,
ListGroupItem,
Row,
@ -117,12 +118,13 @@
<ListGroupItem>
<strong>Heure du réveil</strong> {alarm.time}
</ListGroupItem>
<ListGroupItem>
<strong>Ignorer les exceptions&nbsp;?</strong> {alarm.ignore_exceptions?"oui":"non"}
<ListGroupItem class="d-flex">
<strong>Ignorer les exceptions&nbsp;?</strong>
<Input type="switch" class="ms-2" on:change={() => {obj.ignore_exceptions = !obj.ignore_exceptions; obj.save();}} checked={obj.ignore_exceptions} /> {obj.ignore_exceptions?"oui":"non"}
</ListGroupItem>
{#if alarm.next_time}
<ListGroupItem>
<strong>Prochaine occurrence</strong> <DateFormat date={new Date(alarm.next_time)} dateStyle="long" />
<strong>Prochaine occurrence</strong> <DateFormat date={new Date(obj.next_time)} dateStyle="long" />
</ListGroupItem>
{/if}
</ListGroup>