mirror of
https://github.com/Spythere/srjp-td2.git
synced 2026-05-03 05:28:12 +00:00
chore: added timetable bottom warnings info
This commit is contained in:
@@ -305,6 +305,28 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
<div class="mt-2">
|
||||||
|
<b><u>Kursuje:</u></b>
|
||||||
|
<div>
|
||||||
|
- {{ parseTimetableRunDate(computedTimetableRows[0].scheduledDepartureDate!) }}
|
||||||
|
<span
|
||||||
|
v-if="computedTimetableRows[computedTimetableRows.length - 1].scheduledArrivalDate!.getDate() != computedTimetableRows[0].scheduledDepartureDate!.getDate()"
|
||||||
|
>
|
||||||
|
-
|
||||||
|
{{
|
||||||
|
parseTimetableRunDate(
|
||||||
|
computedTimetableRows[computedTimetableRows.length - 1].scheduledArrivalDate!
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="timetableWarnings.length != 0">
|
||||||
|
<b><u>Uwagi do rozkładu:</u></b>
|
||||||
|
<div>- {{ timetableWarnings }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -313,6 +335,7 @@ import { computed } from 'vue';
|
|||||||
import { useApiStore } from '../../stores/api.store';
|
import { useApiStore } from '../../stores/api.store';
|
||||||
import { useGlobalStore } from '../../stores/global.store';
|
import { useGlobalStore } from '../../stores/global.store';
|
||||||
import type { SceneryRoute, StopRow, TimetablePathData } from '../../types/common.types';
|
import type { SceneryRoute, StopRow, TimetablePathData } from '../../types/common.types';
|
||||||
|
import { parseTimetableRunDate } from '../../utils/dateUtils';
|
||||||
|
|
||||||
const globalStore = useGlobalStore();
|
const globalStore = useGlobalStore();
|
||||||
const apiStore = useApiStore();
|
const apiStore = useApiStore();
|
||||||
@@ -320,6 +343,14 @@ const apiStore = useApiStore();
|
|||||||
// Tymczasowa tabelka z posterunkami APO
|
// Tymczasowa tabelka z posterunkami APO
|
||||||
const apoNames = ['Stary Kisielin, pe', 'Czerwony Dwór, pe', 'Szczejkowice, pe'];
|
const apoNames = ['Stary Kisielin, pe', 'Czerwony Dwór, pe', 'Szczejkowice, pe'];
|
||||||
|
|
||||||
|
const timetableWarnings = computed(() => {
|
||||||
|
const timetableData = globalStore.currentTimetableData;
|
||||||
|
|
||||||
|
if (!timetableData) return '';
|
||||||
|
|
||||||
|
return timetableData.warningNotes;
|
||||||
|
});
|
||||||
|
|
||||||
const computedTimetableRows = computed(() => {
|
const computedTimetableRows = computed(() => {
|
||||||
const timetableData = globalStore.currentTimetableData;
|
const timetableData = globalStore.currentTimetableData;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
const romanMonthDigits = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX', 'X', 'XI', 'XII'];
|
||||||
|
|
||||||
|
export function parseTimetableRunDate(date: Date) {
|
||||||
|
return `${date.getDate()}.${romanMonthDigits[date.getMonth()]}.${date
|
||||||
|
.getFullYear()
|
||||||
|
.toString()
|
||||||
|
.slice(2)}`;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user