Skip to content

Commit

Permalink
refactor: ♻️ fixed time picker
Browse files Browse the repository at this point in the history
  • Loading branch information
adi-lux committed Feb 1, 2024
1 parent 0d4b07a commit 81ddcf1
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 35 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@lucia-auth/adapter-prisma": "3.0.2",
"@prisma/client": "5.6.0",
"lucia": "2.7.4",
"svelty-picker": "^5.2.1",
"unplugin-icons": "^0.18.1"
},
"devDependencies": {
Expand Down
49 changes: 29 additions & 20 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions src/lib/components/meetingSetup/MeetingContinueButton.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
availabilityDates.set($selectedDays);
availabilityTimeBlocks.set(timeBlocks);
ZotDate.initializeAvailabilities($availabilityDates, earliest, latest);
goto("/availability");
if ($availabilityDates.length > 0) {
ZotDate.initializeAvailabilities($availabilityDates, earliest, latest);
goto("/availability");
}
};
</script>

Expand Down
52 changes: 40 additions & 12 deletions src/lib/components/meetingSetup/MeetingTimeField.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<script lang="ts">
import { onMount } from "svelte";
// import {BLOCK_LENGTH} from "$lib/stores/availabilityStores";
import SveltyPicker from "svelty-picker";
import { BLOCK_LENGTH } from "$lib/stores/availabilityStores";
import { DEFAULT_MEETING_TIMES, startTime, endTime } from "$lib/stores/meetingSetupStores";
/* Reset to the default meeting name*/
Expand All @@ -12,20 +15,45 @@

<!--TODO: make custom step -->
<div id="meeting-time-input-container" class="mx-auto mb-3 flex h-12 w-10/12 justify-around gap-5">
<input
type="time"
alt="meeting start time input"
id="meeting-start-time-input"
class="input h-full w-full rounded-lg text-center text-2xl text-zinc-500"
step="900"
<SveltyPicker
inputId="meeting-start-time-input"
inputClasses="h-full w-full rounded-lg text-2xl text-zinc-500"
mode="time"
format="hh:ii"
displayFormat="HH:ii P"
minuteIncrement={BLOCK_LENGTH}
manualInput={true}
autocommit={true}
bind:value={$startTime}
/>
<input
type="time"
alt="meeting end time input"
id="meeting-end-time-input"
class="input h-full w-full rounded-lg text-center text-2xl text-zinc-500"
step="900"
<SveltyPicker
inputId="meeting-end-time-input"
inputClasses="h-full w-full rounded-lg text-2xl text-zinc-500"
mode="time"
format="hh:ii"
displayFormat="HH:ii P"
manualInput={true}
minuteIncrement={BLOCK_LENGTH}
bind:value={$endTime}
autocommit={true}
/>
<!-- <input-->
<!-- type="time"-->
<!-- alt="meeting start time input"-->
<!-- id="meeting-start-time-input"-->
<!-- class="input h-full w-full rounded-lg text-center text-2xl text-zinc-500"-->
<!-- step={BLOCK_LENGTH * 60}-->
<!-- pattern="[0-9]{2}:[0-9]{2}"-->
<!-- bind:value={$startTime}-->
<!-- />-->

<!-- <input-->
<!-- type="time"-->
<!-- alt="meeting end time input"-->
<!-- id="meeting-end-time-input"-->
<!-- class="input h-full w-full rounded-lg text-center text-2xl text-zinc-500"-->
<!-- pattern="[0-9]{2}:[0-9]{2}"-->
<!-- step={BLOCK_LENGTH * 60}-->
<!-- bind:value={$endTime}-->
<!-- />-->
</div>

0 comments on commit 81ddcf1

Please sign in to comment.