Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KItinerary
Commits
cfaaa681
Commit
cfaaa681
authored
Oct 11, 2022
by
Volker Krause
Browse files
Handle the Polish language variant of FlixBus tickets
parent
e2aee0c2
Pipeline
#246149
passed with stage
in 4 minutes and 5 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/lib/scripts/flixbus.js
View file @
cfaaa681
...
...
@@ -23,7 +23,7 @@ function main(content, node) {
function
parseDate
(
year
,
baseDate
,
overrideDate
,
time
)
{
const
s
=
(
overrideDate
?
overrideDate
.
trim
()
:
baseDate
)
+
'
'
+
year
+
'
'
+
time
;
return
JsonLd
.
toDateTime
(
s
,
'
d MMM yyyy hh:mm
'
,
[
'
en
'
,
'
fr
'
]);
return
JsonLd
.
toDateTime
(
s
,
'
d MMM yyyy hh:mm
'
,
[
'
en
'
,
'
fr
'
,
'
pl
'
]);
}
function
parseLocation
(
place
,
addr1
,
addr2
,
links
)
...
...
@@ -51,7 +51,7 @@ function parsePdfTicket(pdf, node, triggerNode)
const
dep
=
text
.
substr
(
idx
).
match
(
/
(\d\d
:
\d\d)
+
(
.*
)\n(\d{1,2}
\S
+
)?(?:
+
(
.*
?)(?:\n
|,
\n
+
(
.*
)\n))?
/
);
if
(
!
dep
)
break
;
idx
+=
dep
.
index
+
dep
[
0
].
length
;
const
bus
=
text
.
substr
(
idx
).
match
(
/^
[
]
+
Bus
+
(
.*
)\n[
]
+
(?:
Direction|à destination de
)
(
.*
)\n
/
);
const
bus
=
text
.
substr
(
idx
).
match
(
/^
[
]
+
(?:
Bus|Autobus
)
+
(
.*
)\n[
]
+
(?:
Direction|à destination de
|Kierunek
)
(
.*
)\n
/
);
if
(
!
bus
)
break
;
idx
+=
bus
.
index
+
bus
[
0
].
length
;
const
arr
=
text
.
substr
(
idx
).
match
(
/^
(\d{1,2}
\S
+
\n)?(\d\d
:
\d\d)
+
(
.*
)\n(?:
+
(
.*
?)(?:\n
|,
\n
+
(
.*
)\n))?
/
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment