Skip to content

Commit e0de29c

Browse files
committed
fix time adjustment button logic after copying from previous wp
1 parent 1b44339 commit e0de29c

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/virtualship/cli/_plan.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -893,6 +893,17 @@ def copy_from_previous(self) -> None:
893893
)
894894
if prev_switch and curr_switch:
895895
curr_switch.value = prev_switch.value
896+
897+
# hard update self.waypoint.time to match new values as shown in UI
898+
year = int(self.query_one(f"#wp{self.index}_year").value)
899+
month = int(self.query_one(f"#wp{self.index}_month").value)
900+
day = int(self.query_one(f"#wp{self.index}_day").value)
901+
hour = int(self.query_one(f"#wp{self.index}_hour").value)
902+
minute = int(self.query_one(f"#wp{self.index}_minute").value)
903+
self.waypoint.time = datetime.datetime(
904+
year, month, day, hour, minute, 0
905+
)
906+
896907
except Exception as e:
897908
raise UnexpectedError(unexpected_msg_compose(e)) from None
898909

0 commit comments

Comments
 (0)