chore: added timetable bottom warnings info

This commit is contained in:
2025-06-22 14:06:22 +02:00
parent 62736d4b04
commit 63262ccf4a
3 changed files with 40 additions and 1 deletions
@@ -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;
+8
View File
@@ -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)}`;
}
+1 -1
View File
@@ -42,4 +42,4 @@ export function getHeadUnits(stockString: string) {
return acc; return acc;
}, [] as string[]); }, [] as string[]);
} }