diff --git a/src/components/Global/SearchBox.vue b/src/components/Global/SearchBox.vue index ac04c9d..a5c9768 100644 --- a/src/components/Global/SearchBox.vue +++ b/src/components/Global/SearchBox.vue @@ -11,7 +11,7 @@ class="search-exit" :src="exitIcon" alt="exit-icon" - @click="() => (compSearchedValue = '')" + @click="clearValue" /> @@ -23,6 +23,7 @@ export default defineComponent({ data: () => ({ exitIcon: require("@/assets/icon-exit.svg"), }), + emits: ["update:searchedValue", "clearValue"], props: { searchedValue: { type: String, @@ -36,6 +37,9 @@ export default defineComponent({ type: String, required: true, }, + clearValue: { + type: Function, + }, }, setup(props, { emit }) { @@ -50,6 +54,11 @@ export default defineComponent({ ); } + const clearValue = () => { + compSearchedValue.value = ""; + emit("clearValue"); + }; + const updateValue = (e) => { if (!props.updateOnInput && e.keyCode == 13) emit("update:searchedValue", compSearchedValue.value); @@ -58,6 +67,7 @@ export default defineComponent({ return { compSearchedValue, updateValue, + clearValue, }; }, }); diff --git a/src/mixins/dateMixin.ts b/src/mixins/dateMixin.ts new file mode 100644 index 0000000..5cd7ead --- /dev/null +++ b/src/mixins/dateMixin.ts @@ -0,0 +1,16 @@ +import { defineComponent } from 'vue'; + +export default defineComponent({ + methods: { + localeDate(dateString: string) { + return new Date(dateString).toLocaleDateString("pl-PL", { + weekday: "long", + day: "numeric", + month: "2-digit", + year: "numeric", + hour:"2-digit", + minute: "2-digit" + }) + } + } +}) diff --git a/src/views/HistoryView.vue b/src/views/HistoryView.vue index c88d278..bfcce94 100644 --- a/src/views/HistoryView.vue +++ b/src/views/HistoryView.vue @@ -2,18 +2,31 @@

Historia rozkładów jazdy

-
+
+ + + Szukaj +
@@ -27,8 +40,9 @@ !item.terminated ? navigateToTrain(item.trainNo) : null " style="cursor: pointer" - >{{ item.trainCategoryCode }} {{ item.trainNo }} + {{ item.trainCategoryCode }} {{ item.trainNo }} +
{{ item.route.replace("|", " - ") }} @@ -62,12 +76,17 @@
- Rozpoczęcie: - {{ new Date(item.beginDate).toLocaleString() }} + Stacje: + {{ item.confirmedStopsCount }} / + {{ item.allStopsCount }}
+
- Zakończenie: {{ new Date(item.endDate).toLocaleString() }} + Rozpoczęcie: + {{ localeDate(item.beginDate) }}
+ +
Zakończenie: {{ localeDate(item.endDate) }}
@@ -76,12 +95,15 @@ @@ -199,7 +254,7 @@ h3 { } ul { - width: 800px; + width: 1000px; } li {