Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

Commit

Permalink
🚸 Change the default value for the timepicker in the createhomework c…
Browse files Browse the repository at this point in the history
…omponents
  • Loading branch information
Dlurak committed Nov 9, 2023
1 parent 0f0dc63 commit b6ab0bc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 22 deletions.
8 changes: 3 additions & 5 deletions src/lib/homework/CreateHomework.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,19 @@
import { addToast } from '$lib/toast/addToast';
import { network } from '../../stores';
import { backendUrl } from '$lib/../stores';
import { getOneWeekFromNow } from '../../constants/generateDates';
export let postSubmit: (e: Event) => void = () => {
return;
};
const currentDate = new Date();
let date = createDate(currentDate);
let assignedAtDateObj: CustomDate;
let assignments: Assignment[] = [
{
subject: '',
description: '',
due: date
due: createDate(getOneWeekFromNow())
}
];
Expand Down Expand Up @@ -73,7 +71,7 @@
{
subject: '',
description: '',
due: date
due: createDate(getOneWeekFromNow())
}
];

Expand Down
27 changes: 10 additions & 17 deletions src/lib/homework/CreateHomeworkInner.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
import I18n from '$lib/I18n.svelte';
import { i } from '../../languages/i18n';
import { subjectsSortetCapitalized } from '../../constants/subjecticons';
import { getOneWeekFromNow } from '../../constants/generateDates';
const currentDate = new Date();
let date = createDate(currentDate);
let date = createDate(getOneWeekFromNow());
export let assignments: Assignment[] = [
{
subject: '',
description: '',
due: date
}
];
const emptyAssignment: Assignment = {
subject: '',
description: '',
due: date
};
export let assignments: Assignment[] = [emptyAssignment];
</script>

<ul class="list-none">
Expand Down Expand Up @@ -99,14 +99,7 @@
colour="yellow"
onClick={(e) => {
e.preventDefault();
assignments = [
...assignments,
{
subject: '',
description: '',
due: date
}
];
assignments = [...assignments, emptyAssignment];
}}
/>
</div>
Expand Down

0 comments on commit b6ab0bc

Please sign in to comment.