遅れ時分考慮機能を仮実装
This commit is contained in:
parent
dfdd9a7f37
commit
f504497bdf
@ -478,6 +478,15 @@ export const EachTrainInfo = ({
|
|||||||
.join("");
|
.join("");
|
||||||
})
|
})
|
||||||
: [];
|
: [];
|
||||||
|
const date = new Date();
|
||||||
|
if (time) {
|
||||||
|
date.setHours(time.split(":")[0], time.split(":")[1]);
|
||||||
|
}
|
||||||
|
console.log(date.toString());
|
||||||
|
if (!isNaN(data.trainData?.delay)) {
|
||||||
|
date.setMinutes(date.getMinutes() + data.trainData?.delay);
|
||||||
|
}
|
||||||
|
const timeString = date.toTimeString().split(" ")[0].split(":");
|
||||||
return (
|
return (
|
||||||
<TouchableWithoutFeedback
|
<TouchableWithoutFeedback
|
||||||
onPress={() => openStationACFromEachTrainInfo(station)}
|
onPress={() => openStationACFromEachTrainInfo(station)}
|
||||||
@ -537,14 +546,29 @@ export const EachTrainInfo = ({
|
|||||||
>
|
>
|
||||||
<Text style={{ fontSize: 20 }}>{station}</Text>
|
<Text style={{ fontSize: 20 }}>{station}</Text>
|
||||||
<View style={{ flex: 1 }} />
|
<View style={{ flex: 1 }} />
|
||||||
<Text style={{ fontSize: 20 }}>
|
<Text
|
||||||
|
style={{
|
||||||
|
fontSize: 20,
|
||||||
|
color: isNaN(data.trainData?.delay)
|
||||||
|
? "black"
|
||||||
|
: data.trainData?.delay == 0
|
||||||
|
? "black"
|
||||||
|
: "red",
|
||||||
|
}}
|
||||||
|
>
|
||||||
{/* {StationNumbers.length != 0 &&
|
{/* {StationNumbers.length != 0 &&
|
||||||
(StationNumbers.includes(currentPosition[0])
|
(StationNumbers.includes(currentPosition[0])
|
||||||
? "にゃーん"
|
? "にゃーん"
|
||||||
: "ほげ")}
|
: "ほげ")}
|
||||||
{currentPosition} */}
|
{currentPosition} */}
|
||||||
{points.includes(index) ? "🚉" : ""}
|
{points.includes(index) ? "🚉" : ""}
|
||||||
{time} {se}
|
{timeString[0]}:{timeString[1]}
|
||||||
|
{se}
|
||||||
|
{isNaN(data.trainData?.delay)
|
||||||
|
? ""
|
||||||
|
: data.trainData?.delay == 0
|
||||||
|
? ""
|
||||||
|
: " 見込み"}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
Loading…
Reference in New Issue
Block a user