Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Commit

Permalink
intrn(post): make range picker for posts
Browse files Browse the repository at this point in the history
  • Loading branch information
KennethTrecy committed Nov 13, 2022
1 parent f0a4581 commit 6c3f4b7
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions components/post/multiviewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
label="Department"
class="filter"
:options="departmentNames"/>
<DateRangePicker
v-model:range-begin="rangeBegin"
v-model:range-end="rangeEnd"
:semesters="semesters"
class="picker"/>
<SelectableExistence v-model="existence" class="existence"/>
</form>

Expand Down Expand Up @@ -71,6 +76,9 @@ import type { PageContext } from "$/types/renderer"
import type { OptionInfo } from "$@/types/component"
import type { DeserializedPostListDocument } from "$/types/documents/post"
import type { DeserializedDepartmentListDocument } from "$/types/documents/department"
import type {
DeserializedSemesterListDocument
} from "$/types/documents/semester"
import { DEFAULT_LIST_LIMIT } from "$/constants/numerical"
import { DEBOUNCED_WAIT_DURATION } from "$@/constants/time"
Expand All @@ -86,6 +94,7 @@ import adjustBeforeMidnightOfNextDay from "$/time/adjust_before_midnight_of_next
import Viewer from "@/post/multiviewer/viewer.vue"
import Suspensible from "@/helpers/suspensible.vue"
import SelectableOptionsField from "@/fields/selectable_options.vue"
import DateRangePicker from "@/helpers/filters/date_range_picker.vue"
import SelectableExistence from "@/fields/selectable_radio/existence.vue"
const pageContext = inject("pageContext") as PageContext<"deserialized">
Expand All @@ -94,7 +103,8 @@ const { userProfile } = pageProps
const props = defineProps<{
departments: DeserializedDepartmentListDocument,
modelValue: DeserializedPostListDocument<"poster"|"posterRole"|"department">
modelValue: DeserializedPostListDocument<"poster"|"posterRole"|"department">,
semesters: DeserializedSemesterListDocument
}>()
interface CustomEvents {
Expand Down Expand Up @@ -187,8 +197,8 @@ async function retrievePosts() {
await loadRemainingResource(posts as Ref<DeserializedPostListDocument>, fetcher, () => ({
"filter": {
"dateTimeRange": {
"begin": rangeBegin,
"end": rangeEnd
"begin": rangeBegin.value,
"end": rangeEnd.value
},
"departmentID": chosenDepartment.value === NULL_AS_STRING ? null : chosenDepartment.value,
"existence": existence.value as "exists"|"archived"|"*"
Expand Down

0 comments on commit 6c3f4b7

Please sign in to comment.