Skip to content

Commit 9efec38

Browse files
committed
fixing typescript errors. using window.setInterval to be specific with the function, using dateInput with display-format so user can technically type in the date if they wish to do so. Adding in placeholder so users know what format to input the date in
1 parent e5e4c08 commit 9efec38

File tree

4 files changed

+10
-25
lines changed

4 files changed

+10
-25
lines changed

src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/Snackbar.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export default {
114114
}
115115
},
116116
timeoutCounter() {
117-
this.polling = setInterval(() => {
117+
this.polling = window.setInterval(() => {
118118
if (this.pause) {
119119
this.timeout += 1;
120120
}

src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/inputs/EceDateInput.vue

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,19 @@
22
<label>
33
{{ label }}
44
<v-date-input
5-
:model-value="value"
6-
:value="formattedDate"
5+
:model-value="modelValue"
76
:aria-label="label"
87
prepend-icon=""
98
label=""
109
v-bind="$attrs"
11-
@update:model-value="(value: string) => updateModelValue(value)"
10+
@update:model-value="(value: any) => updateModelValue(value)"
11+
:display-format="format"
1212
:class="['pt-2', $attrs.class]"
1313
/>
1414
</label>
1515
</template>
1616

1717
<script lang="ts">
18-
import { formatDate } from "@/utils/format";
1918
import { DateTime } from "luxon";
2019
import { defineComponent, type PropType } from "vue";
2120
@@ -30,34 +29,23 @@ export default defineComponent({
3029
type: String,
3130
default: "Select Date",
3231
},
32+
format: {
33+
type: String,
34+
default: "fullDate",
35+
required: false,
36+
},
3337
},
3438
emits: ["update:model-value"],
3539
methods: {
3640
/**
3741
* Update the model value with string formatted as "yyyy-MM-dd"
3842
* @param value - JS date value as a string
3943
*/
40-
updateModelValue(value: string) {
44+
updateModelValue(value: Date) {
4145
const luxonDate = DateTime.fromJSDate(new Date(value));
4246
const formattedDate = luxonDate.toFormat("yyyy-MM-dd");
4347
this.$emit("update:model-value", formattedDate);
4448
},
4549
},
46-
computed: {
47-
/**
48-
* Format the date as "LLLL d, yyyy" to display in the input field
49-
*/
50-
formattedDate() {
51-
return formatDate(this.modelValue ?? "", "LLLL d, yyyy");
52-
},
53-
value() {
54-
if (!this.modelValue) {
55-
return; // Return current date as default Date object
56-
}
57-
// Convert modelValue to a Date object for date picker consistency
58-
const [year, month, day] = this.modelValue.split("-").map(Number);
59-
return new Date(year, month - 1, day); // No UTC to keep in local time
60-
},
61-
},
6250
});
6351
</script>

src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/inputs/EceEducation.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@
141141
]"
142142
label="Start date of program or course"
143143
maxlength="50"
144-
placeholder=""
145144
:max="today"
146145
></EceDateInput>
147146
</v-col>
@@ -162,7 +161,6 @@
162161
]"
163162
label="End date of program or course"
164163
maxlength="50"
165-
placeholder=""
166164
:max="today"
167165
></EceDateInput>
168166
</v-col>

src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/pages/NewUser.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
:rules="[Rules.required(), Rules.futureDateNotAllowedRule()]"
5959
:max="today"
6060
label="Date of birth"
61-
placeholder=""
6261
></EceDateInput>
6362
</v-col>
6463
</v-row>

0 commit comments

Comments
 (0)