mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-30 00:20:07 +00:00
fix(trips): a day added before the start leaves the plan on its dates
Adding a day before a trip's start with "Keep bookings on their dates" moved almost everything a day earlier and emptied the last day. The day grid was always rebuilt by position: the n-th day row took the n-th date of the new range. With bookings kept on their dates, only timed bookings and stays were re-anchored afterwards. Places, day notes, bookings with no time and a booking's place in a day's order stayed on their re-dated rows and slid to the day before. Days added at both ends had the same problem. planDayGrid now takes keepDates. When the new range still holds every dated day, each of them keeps its date and the new days go around them. The server passes it unless the traveller chose to shift everything, and the trip dialog's warning check uses the same rule. A moved or shorter range still follows the positional rule the dialog describes, and "Shift everything" still moves the whole plan with the new start. Two things keyed outside the day rows followed the old rule. Road trip day boundaries are keyed by day number, so a new first day left each one on the day before its own. They now follow their days to their new numbers and go out to every screen. The owner's leave days moved by the change of start even when days were only added. They now move by as far as the trip's first day moved, which is nothing when days are only added. The help text of the option and the MCP description say what happens when days are added. Closes #3119
This commit is contained in:
@@ -139,7 +139,7 @@ const dashboard: TranslationStrings = {
|
||||
'dashboard.dateShiftIntro': 'لقد غيّرت موعد بداية هذه الرحلة. كيف تريد أن تتبع خططك التواريخ الجديدة؟',
|
||||
'dashboard.dateShiftKeepBookings': 'إبقاء الحجوزات في تواريخها',
|
||||
'dashboard.dateShiftKeepBookingsDesc':
|
||||
'تنتقل خطط الأيام مع التواريخ الجديدة، بينما تبقى الحجوزات وأماكن الإقامة في تواريخها الأصلية ما دامت تلك التواريخ لا تزال ضمن الرحلة.',
|
||||
'تبقى الأيام المضافة فارغة ولا يتحرك أي شيء آخر. وإذا انتقلت الرحلة، تنتقل خطط الأيام مع التواريخ الجديدة، بينما تبقى الحجوزات وأماكن الإقامة في تواريخها الأصلية ما دامت تلك التواريخ لا تزال ضمن الرحلة.',
|
||||
'dashboard.dateShiftAll': 'نقل كل شيء',
|
||||
'dashboard.dateShiftAllDesc': 'ينتقل خط سير الرحلة بالكامل مع التواريخ الجديدة، بما في ذلك الحجوزات وأماكن الإقامة.',
|
||||
'dashboard.dateShiftHint':
|
||||
|
||||
@@ -123,7 +123,7 @@ const dashboard: TranslationStrings = {
|
||||
'Səyahətin başlama tarixini dəyişdiniz. Planlarınız yeni tarixlərə necə uyğunlaşdırılsın?',
|
||||
'dashboard.dateShiftKeepBookings': 'Rezervasiyaların tarixlərini saxla',
|
||||
'dashboard.dateShiftKeepBookingsDesc':
|
||||
'Günlük planlar yeni tarixlərə köçürülür, rezervasiya və yaşayış yerləri isə tarixləri hələ də səyahət müddətinə daxil olduğu halda ilkin tarixlərində qalır.',
|
||||
'Əlavə etdiyiniz günlər boş qalır və başqa heç nə yerini dəyişmir. Səyahət köçürülərsə, günlük planlar yeni tarixlərə köçürülür, rezervasiya və yaşayış yerləri isə tarixləri hələ də səyahət müddətinə daxil olduğu halda ilkin tarixlərində qalır.',
|
||||
'dashboard.dateShiftAll': 'Hər şeyi yeni tarixlərə köçür',
|
||||
'dashboard.dateShiftAllDesc':
|
||||
'Rezervasiya və yaşayış yerləri də daxil olmaqla bütün səyahət planı yeni tarixlərə köçürülür.',
|
||||
|
||||
@@ -107,7 +107,7 @@ const dashboard: TranslationStrings = {
|
||||
'dashboard.dateShiftIntro': 'Você alterou o início desta viagem. Como seus planos devem acompanhar as novas datas?',
|
||||
'dashboard.dateShiftKeepBookings': 'Manter reservas em suas datas',
|
||||
'dashboard.dateShiftKeepBookingsDesc':
|
||||
'Os planos diários acompanham as novas datas, enquanto reservas e hospedagens permanecem nas datas originais, desde que ainda façam parte da viagem.',
|
||||
'Os dias adicionados ficam vazios e nada mais muda de lugar. Se a viagem mudar de data, os planos diários acompanham as novas datas, enquanto reservas e hospedagens permanecem nas datas originais, desde que ainda façam parte da viagem.',
|
||||
'dashboard.dateShiftAll': 'Mover tudo',
|
||||
'dashboard.dateShiftAllDesc': 'Todo o itinerário acompanha as novas datas, incluindo reservas e hospedagens.',
|
||||
'dashboard.dateShiftHint':
|
||||
|
||||
@@ -195,7 +195,7 @@ const dashboard: TranslationStrings = {
|
||||
'Has canviat quan comença aquest viatge. Com han de seguir els teus plans les noves dates?',
|
||||
'dashboard.dateShiftKeepBookings': 'Mantén les reserves a les seves dates',
|
||||
'dashboard.dateShiftKeepBookingsDesc':
|
||||
'Els plans de cada dia es mouen amb les noves dates, mentre que les reserves i els allotjaments es mantenen a les seves dates originals sempre que aquestes segueixin formant part del viatge.',
|
||||
'Els dies que afegeixis queden buits i res més es mou. Si el viatge es desplaça, els plans de cada dia es mouen amb les noves dates, mentre que les reserves i els allotjaments es mantenen a les seves dates originals sempre que aquestes segueixin formant part del viatge.',
|
||||
'dashboard.dateShiftAll': 'Mou-ho tot',
|
||||
'dashboard.dateShiftAllDesc': "Tot l'itinerari es mou amb les noves dates, incloses les reserves i els allotjaments.",
|
||||
'dashboard.dateShiftHint':
|
||||
|
||||
@@ -115,7 +115,7 @@ const dashboard: TranslationStrings = {
|
||||
'dashboard.dateShiftIntro': 'Změnili jste začátek této cesty. Jak se mají vaše plány přizpůsobit novým termínům?',
|
||||
'dashboard.dateShiftKeepBookings': 'Ponechat rezervace v původních termínech',
|
||||
'dashboard.dateShiftKeepBookingsDesc':
|
||||
'Denní plány se posunou podle nových termínů, zatímco rezervace a ubytování zůstanou v původních termínech, pokud jsou stále součástí cesty.',
|
||||
'Přidané dny zůstanou prázdné a nic dalšího se neposune. Pokud se cesta posune, denní plány se posunou podle nových termínů, zatímco rezervace a ubytování zůstanou v původních termínech, pokud jsou stále součástí cesty.',
|
||||
'dashboard.dateShiftAll': 'Posunout vše',
|
||||
'dashboard.dateShiftAllDesc': 'Celý itinerář se posune podle nových termínů, včetně rezervací a ubytování.',
|
||||
'dashboard.dateShiftHint':
|
||||
|
||||
@@ -109,7 +109,7 @@ const dashboard: TranslationStrings = {
|
||||
'Du hast den Beginn dieser Reise geändert. Wie sollen deine Pläne den neuen Daten folgen?',
|
||||
'dashboard.dateShiftKeepBookings': 'Buchungen auf ihren Terminen belassen',
|
||||
'dashboard.dateShiftKeepBookingsDesc':
|
||||
'Tagespläne wandern mit den neuen Daten, während Reservierungen und Unterkünfte auf ihren ursprünglichen Terminen bleiben, solange diese noch Teil der Reise sind.',
|
||||
'Hinzugefügte Tage bleiben leer, sonst verschiebt sich nichts. Wird die Reise verschoben, wandern Tagespläne mit den neuen Daten, während Reservierungen und Unterkünfte auf ihren ursprünglichen Terminen bleiben, solange diese noch Teil der Reise sind.',
|
||||
'dashboard.dateShiftAll': 'Alles verschieben',
|
||||
'dashboard.dateShiftAllDesc':
|
||||
'Der gesamte Reiseplan wandert mit den neuen Daten, einschließlich Reservierungen und Unterkünften.',
|
||||
|
||||
@@ -121,7 +121,7 @@ const dashboard: TranslationStrings = {
|
||||
'dashboard.dateShiftIntro': 'You changed when this trip starts. How should your plans follow the new dates?',
|
||||
'dashboard.dateShiftKeepBookings': 'Keep bookings on their dates',
|
||||
'dashboard.dateShiftKeepBookingsDesc':
|
||||
'Day plans move with the new dates, while reservations and accommodations stay on their original dates as long as those are still part of the trip.',
|
||||
'Days you add stay empty and nothing else moves. If the trip moves, day plans move with the new dates, while reservations and accommodations stay on their original dates as long as those are still part of the trip.',
|
||||
'dashboard.dateShiftAll': 'Shift everything',
|
||||
'dashboard.dateShiftAllDesc':
|
||||
'The entire itinerary moves with the new dates, including reservations and accommodations.',
|
||||
|
||||
@@ -108,7 +108,7 @@ const dashboard: TranslationStrings = {
|
||||
'Has cambiado cuándo empieza este viaje. ¿Cómo deben seguir tus planes las nuevas fechas?',
|
||||
'dashboard.dateShiftKeepBookings': 'Mantener las reservas en sus fechas',
|
||||
'dashboard.dateShiftKeepBookingsDesc':
|
||||
'Los planes de cada día se mueven con las nuevas fechas, mientras que las reservas y los alojamientos permanecen en sus fechas originales siempre que sigan formando parte del viaje.',
|
||||
'Los días que añadas quedan vacíos y nada más se mueve. Si el viaje se desplaza, los planes de cada día se mueven con las nuevas fechas, mientras que las reservas y los alojamientos permanecen en sus fechas originales siempre que sigan formando parte del viaje.',
|
||||
'dashboard.dateShiftAll': 'Mover todo',
|
||||
'dashboard.dateShiftAllDesc':
|
||||
'Todo el itinerario se mueve con las nuevas fechas, incluidas las reservas y los alojamientos.',
|
||||
|
||||
@@ -121,7 +121,7 @@ const dashboard: TranslationStrings = {
|
||||
'dashboard.dateShiftIntro': 'Muutsid reisi algust. Kuidas peaksid plaanid uute kuupäevadega kohanema?',
|
||||
'dashboard.dateShiftKeepBookings': 'Jäta broneeringud oma kuupäevadele',
|
||||
'dashboard.dateShiftKeepBookingsDesc':
|
||||
'Päevaplaanid liiguvad uutele kuupäevadele, kuid broneeringud ja majutused jäävad algsetele kuupäevadele, kui need jäävad endiselt reisi sisse.',
|
||||
'Lisatud päevad jäävad tühjaks ja midagi muud ei liigu. Kui reis nihkub, liiguvad päevaplaanid uutele kuupäevadele, kuid broneeringud ja majutused jäävad algsetele kuupäevadele, kui need jäävad endiselt reisi sisse.',
|
||||
'dashboard.dateShiftAll': 'Nihuta kõike',
|
||||
'dashboard.dateShiftAllDesc': 'Kogu reisiplaan, sealhulgas broneeringud ja majutused, liigub uutele kuupäevadele.',
|
||||
'dashboard.dateShiftHint': 'Vihje: ainult osa reisiplaani nihutamiseks kasuta planeerijas valikut „Lisa päev“.',
|
||||
|
||||
@@ -110,7 +110,7 @@ const dashboard: TranslationStrings = {
|
||||
'Vous avez modifié la date de début de ce voyage. Comment vos plans doivent-ils suivre les nouvelles dates ?',
|
||||
'dashboard.dateShiftKeepBookings': 'Conserver les réservations à leurs dates',
|
||||
'dashboard.dateShiftKeepBookingsDesc':
|
||||
"Les plans journaliers suivent les nouvelles dates, tandis que les réservations et hébergements restent à leurs dates d'origine tant que celles-ci font toujours partie du voyage.",
|
||||
"Les jours ajoutés restent vides et rien d'autre ne bouge. Si le voyage est décalé, les plans journaliers suivent les nouvelles dates, tandis que les réservations et hébergements restent à leurs dates d'origine tant que celles-ci font toujours partie du voyage.",
|
||||
'dashboard.dateShiftAll': 'Tout décaler',
|
||||
'dashboard.dateShiftAllDesc':
|
||||
"L'itinéraire entier suit les nouvelles dates, y compris les réservations et hébergements.",
|
||||
|
||||
@@ -120,7 +120,7 @@ const dashboard: TranslationStrings = {
|
||||
'Αλλάξατε την ημερομηνία έναρξης αυτού του ταξιδιού. Πώς θέλετε να ακολουθήσουν τα σχέδιά σας τις νέες ημερομηνίες;',
|
||||
'dashboard.dateShiftKeepBookings': 'Διατήρηση κρατήσεων στις ημερομηνίες τους',
|
||||
'dashboard.dateShiftKeepBookingsDesc':
|
||||
'Τα σχέδια ημέρας μετακινούνται με τις νέες ημερομηνίες, ενώ οι κρατήσεις και τα καταλύματα παραμένουν στις αρχικές τους ημερομηνίες, εφόσον αυτές εξακολουθούν να ανήκουν στο ταξίδι.',
|
||||
'Οι ημέρες που προσθέτετε μένουν κενές και τίποτα άλλο δεν μετακινείται. Αν το ταξίδι μετακινηθεί, τα σχέδια ημέρας μετακινούνται με τις νέες ημερομηνίες, ενώ οι κρατήσεις και τα καταλύματα παραμένουν στις αρχικές τους ημερομηνίες, εφόσον αυτές εξακολουθούν να ανήκουν στο ταξίδι.',
|
||||
'dashboard.dateShiftAll': 'Μετατόπιση όλων',
|
||||
'dashboard.dateShiftAllDesc':
|
||||
'Ολόκληρο το δρομολόγιο μετακινείται με τις νέες ημερομηνίες, συμπεριλαμβανομένων των κρατήσεων και των καταλυμάτων.',
|
||||
|
||||
@@ -129,7 +129,7 @@ const dashboard: TranslationStrings = {
|
||||
'dashboard.dateShiftIntro': 'שיניתם את מועד תחילת הטיול. איך התוכניות שלכם צריכות לעבור לתאריכים החדשים?',
|
||||
'dashboard.dateShiftKeepBookings': 'השארת ההזמנות בתאריכים שלהן',
|
||||
'dashboard.dateShiftKeepBookingsDesc':
|
||||
'התוכניות היומיות עוברות לתאריכים החדשים, וההזמנות והלינות נשארות בתאריכים המקוריים כל עוד הם עדיין חלק מהטיול.',
|
||||
'ימים שנוספו נשארים ריקים ושום דבר אחר לא זז. אם הטיול זז, התוכניות היומיות עוברות לתאריכים החדשים, וההזמנות והלינות נשארות בתאריכים המקוריים כל עוד הם עדיין חלק מהטיול.',
|
||||
'dashboard.dateShiftAll': 'הזזת הכל',
|
||||
'dashboard.dateShiftAllDesc': 'כל המסלול עובר לתאריכים החדשים, כולל הזמנות ולינות.',
|
||||
'dashboard.dateShiftHint':
|
||||
|
||||
@@ -109,7 +109,7 @@ const dashboard: TranslationStrings = {
|
||||
'dashboard.dateShiftIntro': 'Megváltoztattad az út kezdetét. Hogyan kövessék a terveid az új dátumokat?',
|
||||
'dashboard.dateShiftKeepBookings': 'A foglalások maradjanak a saját dátumaikon',
|
||||
'dashboard.dateShiftKeepBookingsDesc':
|
||||
'A napi tervek az új dátumokkal együtt mozognak, míg a foglalások és szállások az eredeti dátumaikon maradnak, amíg azok még az út részei.',
|
||||
'A hozzáadott napok üresek maradnak, és semmi más nem mozdul. Ha az út eltolódik, a napi tervek az új dátumokkal együtt mozognak, míg a foglalások és szállások az eredeti dátumaikon maradnak, amíg azok még az út részei.',
|
||||
'dashboard.dateShiftAll': 'Minden eltolása',
|
||||
'dashboard.dateShiftAllDesc':
|
||||
'A teljes útiterv az új dátumokkal együtt mozog, beleértve a foglalásokat és a szállásokat is.',
|
||||
|
||||
@@ -100,7 +100,7 @@ const dashboard: TranslationStrings = {
|
||||
'Kamu mengubah tanggal mulai perjalanan ini. Bagaimana rencanamu harus mengikuti tanggal baru?',
|
||||
'dashboard.dateShiftKeepBookings': 'Pertahankan pesanan pada tanggalnya',
|
||||
'dashboard.dateShiftKeepBookingsDesc':
|
||||
'Rencana harian ikut berpindah ke tanggal baru, sementara reservasi dan akomodasi tetap pada tanggal aslinya selama tanggal tersebut masih termasuk dalam perjalanan.',
|
||||
'Hari yang ditambahkan tetap kosong dan tidak ada hal lain yang berpindah. Jika perjalanan bergeser, rencana harian ikut berpindah ke tanggal baru, sementara reservasi dan akomodasi tetap pada tanggal aslinya selama tanggal tersebut masih termasuk dalam perjalanan.',
|
||||
'dashboard.dateShiftAll': 'Geser semuanya',
|
||||
'dashboard.dateShiftAllDesc':
|
||||
'Seluruh rencana perjalanan berpindah ke tanggal baru, termasuk reservasi dan akomodasi.',
|
||||
|
||||
@@ -110,7 +110,7 @@ const dashboard: TranslationStrings = {
|
||||
'Hai modificato la data di inizio di questo viaggio. Come devono adattarsi i tuoi piani alle nuove date?',
|
||||
'dashboard.dateShiftKeepBookings': 'Mantieni le prenotazioni alle loro date',
|
||||
'dashboard.dateShiftKeepBookingsDesc':
|
||||
'I programmi giornalieri si spostano con le nuove date, mentre prenotazioni e alloggi restano alle date originali, purché queste facciano ancora parte del viaggio.',
|
||||
"I giorni aggiunti restano vuoti e nient'altro si sposta. Se il viaggio si sposta, i programmi giornalieri si spostano con le nuove date, mentre prenotazioni e alloggi restano alle date originali, purché queste facciano ancora parte del viaggio.",
|
||||
'dashboard.dateShiftAll': 'Sposta tutto',
|
||||
'dashboard.dateShiftAllDesc': "L'intero itinerario si sposta con le nuove date, incluse prenotazioni e alloggi.",
|
||||
'dashboard.dateShiftHint':
|
||||
|
||||
@@ -114,7 +114,7 @@ const dashboard: TranslationStrings = {
|
||||
'dashboard.dateShiftIntro': '旅行の開始日が変更されました。予定を新しい日程にどのように合わせますか?',
|
||||
'dashboard.dateShiftKeepBookings': '予約を元の日付のままにする',
|
||||
'dashboard.dateShiftKeepBookingsDesc':
|
||||
'日別計画は新しい日程に合わせて移動しますが、予約と宿泊先は旅行期間内にある限り元の日付のままになります。',
|
||||
'追加した日は空のままで、ほかは何も動きません。旅行の日程がずれる場合、日別計画は新しい日程に合わせて移動しますが、予約と宿泊先は旅行期間内にある限り元の日付のままになります。',
|
||||
'dashboard.dateShiftAll': 'すべてを移動する',
|
||||
'dashboard.dateShiftAllDesc': '予約や宿泊先を含む旅程全体が新しい日程に合わせて移動します。',
|
||||
'dashboard.dateShiftHint':
|
||||
|
||||
@@ -114,7 +114,7 @@ const dashboard: TranslationStrings = {
|
||||
'dashboard.dateShiftIntro': '여행 시작일이 변경되었습니다. 계획을 새 날짜에 어떻게 맞출까요?',
|
||||
'dashboard.dateShiftKeepBookings': '예약은 원래 날짜에 유지',
|
||||
'dashboard.dateShiftKeepBookingsDesc':
|
||||
'일별 계획은 새 날짜로 이동하고, 예약과 숙박은 여행 기간에 포함되어 있는 한 원래 날짜에 그대로 유지됩니다.',
|
||||
'추가한 날은 비어 있고 다른 것은 움직이지 않습니다. 여행 일정이 옮겨지면 일별 계획은 새 날짜로 이동하고, 예약과 숙박은 여행 기간에 포함되어 있는 한 원래 날짜에 그대로 유지됩니다.',
|
||||
'dashboard.dateShiftAll': '모두 이동',
|
||||
'dashboard.dateShiftAllDesc': '예약과 숙박을 포함한 전체 일정이 새 날짜로 이동합니다.',
|
||||
'dashboard.dateShiftHint':
|
||||
|
||||
@@ -108,7 +108,7 @@ const dashboard: TranslationStrings = {
|
||||
'Je hebt gewijzigd wanneer deze reis begint. Hoe moeten je plannen de nieuwe datums volgen?',
|
||||
'dashboard.dateShiftKeepBookings': 'Boekingen op hun datums houden',
|
||||
'dashboard.dateShiftKeepBookingsDesc':
|
||||
'Dagplannen verschuiven mee met de nieuwe datums, terwijl reserveringen en accommodaties op hun oorspronkelijke datums blijven zolang die nog binnen de reis vallen.',
|
||||
'Toegevoegde dagen blijven leeg en verder verschuift er niets. Als de reis verschuift, verschuiven dagplannen mee met de nieuwe datums, terwijl reserveringen en accommodaties op hun oorspronkelijke datums blijven zolang die nog binnen de reis vallen.',
|
||||
'dashboard.dateShiftAll': 'Alles verschuiven',
|
||||
'dashboard.dateShiftAllDesc':
|
||||
'De volledige reisplanning verschuift mee met de nieuwe datums, inclusief reserveringen en accommodaties.',
|
||||
|
||||
@@ -116,7 +116,7 @@ const dashboard: TranslationStrings = {
|
||||
'Data rozpoczęcia podróży została zmieniona. Jak plany mają dostosować się do nowych dat?',
|
||||
'dashboard.dateShiftKeepBookings': 'Zachowaj rezerwacje w ich terminach',
|
||||
'dashboard.dateShiftKeepBookingsDesc':
|
||||
'Plany dnia przesuną się wraz z nowymi datami, a rezerwacje i noclegi pozostaną w swoich pierwotnych terminach, o ile nadal mieszczą się one w ramach podróży.',
|
||||
'Dodane dni pozostaną puste i nic więcej się nie przesunie. Jeśli podróż się przesunie, plany dnia przesuną się wraz z nowymi datami, a rezerwacje i noclegi pozostaną w swoich pierwotnych terminach, o ile nadal mieszczą się one w ramach podróży.',
|
||||
'dashboard.dateShiftAll': 'Przesuń wszystko',
|
||||
'dashboard.dateShiftAllDesc': 'Cały plan podróży przesunie się wraz z nowymi datami, w tym rezerwacje i noclegi.',
|
||||
'dashboard.dateShiftHint':
|
||||
|
||||
@@ -123,7 +123,7 @@ const dashboard: TranslationStrings = {
|
||||
'dashboard.dateShiftIntro': 'Вы изменили дату начала поездки. Как перенести ваши планы на новые даты?',
|
||||
'dashboard.dateShiftKeepBookings': 'Оставить бронирования на своих датах',
|
||||
'dashboard.dateShiftKeepBookingsDesc':
|
||||
'Планы дней переносятся на новые даты, а бронирования и жильё остаются на исходных датах, пока те входят в поездку.',
|
||||
'Добавленные дни остаются пустыми, всё остальное остаётся на месте. Если поездка сдвигается, планы дней переносятся на новые даты, а бронирования и жильё остаются на исходных датах, пока те входят в поездку.',
|
||||
'dashboard.dateShiftAll': 'Перенести всё',
|
||||
'dashboard.dateShiftAllDesc': 'Весь маршрут переносится на новые даты, включая бронирования и жильё.',
|
||||
'dashboard.dateShiftHint':
|
||||
|
||||
@@ -129,7 +129,7 @@ const dashboard: TranslationStrings = {
|
||||
'dashboard.dateShiftIntro': 'Zmenili ste začiatok tejto cesty. Ako sa majú vaše plány prispôsobiť novým termínom?',
|
||||
'dashboard.dateShiftKeepBookings': 'Ponechať rezervácie v pôvodných termínoch',
|
||||
'dashboard.dateShiftKeepBookingsDesc':
|
||||
'Denné plány sa posunú podľa nových termínov, zatiaľ čo rezervácie a ubytovania zostanú v pôvodných termínoch, pokiaľ sú stále súčasťou cesty.',
|
||||
'Pridané dni zostanú prázdne a nič iné sa neposunie. Ak sa cesta posunie, denné plány sa posunú podľa nových termínov, zatiaľ čo rezervácie a ubytovania zostanú v pôvodných termínoch, pokiaľ sú stále súčasťou cesty.',
|
||||
'dashboard.dateShiftAll': 'Posunúť všetko',
|
||||
'dashboard.dateShiftAllDesc': 'Celý itinerár sa posunie podľa nových termínov vrátane rezervácií a ubytovaní.',
|
||||
'dashboard.dateShiftHint':
|
||||
|
||||
@@ -121,7 +121,7 @@ const dashboard: TranslationStrings = {
|
||||
'dashboard.dateShiftIntro': 'Du har ändrat när resan börjar. Hur ska dina planer följa de nya datumen?',
|
||||
'dashboard.dateShiftKeepBookings': 'Behåll bokningar på sina datum',
|
||||
'dashboard.dateShiftKeepBookingsDesc':
|
||||
'Dagsplanerna flyttas med de nya datumen, medan bokningar och boenden ligger kvar på sina ursprungliga datum så länge dessa fortfarande ingår i resan.',
|
||||
'Tillagda dagar förblir tomma och inget annat flyttas. Om resan flyttas, flyttas dagsplanerna med de nya datumen, medan bokningar och boenden ligger kvar på sina ursprungliga datum så länge dessa fortfarande ingår i resan.',
|
||||
'dashboard.dateShiftAll': 'Flytta allt',
|
||||
'dashboard.dateShiftAllDesc': 'Hela resplanen flyttas med de nya datumen, inklusive bokningar och boenden.',
|
||||
'dashboard.dateShiftHint':
|
||||
|
||||
@@ -113,7 +113,7 @@ const dashboard: TranslationStrings = {
|
||||
'dashboard.dateShiftIntro': 'คุณเปลี่ยนวันที่เริ่มต้นของการเดินทางครั้งนี้ แผนของคุณควรปรับตามวันที่ใหม่อย่างไร',
|
||||
'dashboard.dateShiftKeepBookings': 'ทำการจองตามวันที่ของพวกเขา',
|
||||
'dashboard.dateShiftKeepBookingsDesc':
|
||||
'แผนรายวันจะเปลี่ยนไปตามวันที่ใหม่ ในขณะที่การจองและที่พักจะยังคงเป็นวันที่เดิม ตราบใดที่ยังเป็นส่วนหนึ่งของการเดินทาง',
|
||||
'วันที่เพิ่มเข้ามาจะว่างอยู่และไม่มีสิ่งอื่นเลื่อน หากทริปถูกเลื่อน แผนรายวันจะเปลี่ยนไปตามวันที่ใหม่ ในขณะที่การจองและที่พักจะยังคงเป็นวันที่เดิม ตราบใดที่ยังเป็นส่วนหนึ่งของการเดินทาง',
|
||||
'dashboard.dateShiftAll': 'เลื่อนทุกอย่างตามวันใหม่',
|
||||
'dashboard.dateShiftAllDesc': 'แผนการเดินทางทั้งหมดจะย้ายไปพร้อมกับวันที่ใหม่ รวมถึงการจองและที่พัก',
|
||||
'dashboard.dateShiftHint': 'เคล็ดลับ: หากต้องการเปลี่ยนแผนการเดินทางเพียงบางส่วน ให้ใช้ "เพิ่มวัน" ในเครื่องมือวางแผนแทน',
|
||||
|
||||
@@ -122,7 +122,7 @@ const dashboard: TranslationStrings = {
|
||||
'Bu seyahatin başlangıç tarihini değiştirdiniz. Planlarınız yeni tarihlere nasıl uyum sağlasın?',
|
||||
'dashboard.dateShiftKeepBookings': 'Rezervasyonları kendi tarihlerinde tut',
|
||||
'dashboard.dateShiftKeepBookingsDesc':
|
||||
'Gün planları yeni tarihlerle birlikte taşınır; rezervasyonlar ve konaklamalar ise seyahatin kapsamında kaldıkları sürece orijinal tarihlerinde kalır.',
|
||||
'Eklenen günler boş kalır ve başka hiçbir şey yer değiştirmez. Seyahat kaydırılırsa gün planları yeni tarihlerle birlikte taşınır; rezervasyonlar ve konaklamalar ise seyahatin kapsamında kaldıkları sürece orijinal tarihlerinde kalır.',
|
||||
'dashboard.dateShiftAll': 'Her şeyi kaydır',
|
||||
'dashboard.dateShiftAllDesc': 'Rezervasyonlar ve konaklamalar dahil tüm plan yeni tarihlerle birlikte taşınır.',
|
||||
'dashboard.dateShiftHint':
|
||||
|
||||
@@ -139,7 +139,7 @@ const dashboard: TranslationStrings = {
|
||||
'dashboard.dateShiftIntro': 'Ви змінили дату початку поїздки. Як ваші плани мають перейти на нові дати?',
|
||||
'dashboard.dateShiftKeepBookings': 'Залишити бронювання на своїх датах',
|
||||
'dashboard.dateShiftKeepBookingsDesc':
|
||||
'Плани днів переміщуються разом із новими датами, а бронювання та проживання залишаються на своїх початкових датах, поки ті все ще входять до поїздки.',
|
||||
'Додані дні залишаються порожніми, усе інше лишається на місці. Якщо поїздка зсувається, плани днів переміщуються разом із новими датами, а бронювання та проживання залишаються на своїх початкових датах, поки ті все ще входять до поїздки.',
|
||||
'dashboard.dateShiftAll': 'Перемістити все',
|
||||
'dashboard.dateShiftAllDesc': 'Весь маршрут переміщується на нові дати, включно з бронюваннями та проживанням.',
|
||||
'dashboard.dateShiftHint':
|
||||
|
||||
@@ -106,7 +106,7 @@ const dashboard: TranslationStrings = {
|
||||
'Bạn đã thay đổi thời điểm bắt đầu chuyến đi. Các kế hoạch của bạn nên theo ngày mới như thế nào?',
|
||||
'dashboard.dateShiftKeepBookings': 'Giữ đặt chỗ theo ngày ban đầu',
|
||||
'dashboard.dateShiftKeepBookingsDesc':
|
||||
'Kế hoạch theo ngày sẽ dời theo ngày mới, trong khi đặt chỗ và chỗ ở vẫn giữ nguyên ngày ban đầu miễn là những ngày đó vẫn nằm trong chuyến đi.',
|
||||
'Các ngày được thêm vẫn trống và không có gì khác bị dời. Nếu chuyến đi bị dời, kế hoạch theo ngày sẽ dời theo ngày mới, trong khi đặt chỗ và chỗ ở vẫn giữ nguyên ngày ban đầu miễn là những ngày đó vẫn nằm trong chuyến đi.',
|
||||
'dashboard.dateShiftAll': 'Dời tất cả',
|
||||
'dashboard.dateShiftAllDesc': 'Toàn bộ lịch trình sẽ dời theo ngày mới, bao gồm cả đặt chỗ và chỗ ở.',
|
||||
'dashboard.dateShiftHint':
|
||||
|
||||
@@ -99,7 +99,7 @@ const dashboard: TranslationStrings = {
|
||||
'dashboard.dateShiftIntro': '你變更了旅行的開始時間。你的計劃要如何配合新日期?',
|
||||
'dashboard.dateShiftKeepBookings': '預訂保留在原日期',
|
||||
'dashboard.dateShiftKeepBookingsDesc':
|
||||
'每日計劃會隨新日期移動,而預訂和住宿只要仍在旅行期間內,就會保留在原本的日期。',
|
||||
'新增的日期會保持空白,其他內容都不會移動。如果旅行日期整體移動,每日計劃會隨新日期移動,而預訂和住宿只要仍在旅行期間內,就會保留在原本的日期。',
|
||||
'dashboard.dateShiftAll': '全部移動',
|
||||
'dashboard.dateShiftAllDesc': '整個行程都會隨新日期移動,包括預訂和住宿。',
|
||||
'dashboard.dateShiftHint':
|
||||
|
||||
@@ -99,7 +99,7 @@ const dashboard: TranslationStrings = {
|
||||
'dashboard.dateShiftIntro': '您更改了旅行的开始时间。您的计划应如何适应新的日期?',
|
||||
'dashboard.dateShiftKeepBookings': '保留预订的原定日期',
|
||||
'dashboard.dateShiftKeepBookingsDesc':
|
||||
'日程计划将随新日期移动,而预订和住宿只要仍在旅行日期范围内,就保留其原定日期。',
|
||||
'新增的日期保持为空,其他内容都不会移动。如果旅行日期整体移动,日程计划将随新日期移动,而预订和住宿只要仍在旅行日期范围内,就保留其原定日期。',
|
||||
'dashboard.dateShiftAll': '全部顺移',
|
||||
'dashboard.dateShiftAllDesc': '整个行程将随新日期移动,包括预订和住宿。',
|
||||
'dashboard.dateShiftHint':
|
||||
|
||||
@@ -200,6 +200,42 @@ describe('planDayGrid', () => {
|
||||
expect(gone(p)).toEqual(['10:overflow', '11:spare']);
|
||||
});
|
||||
|
||||
describe('keeping dates (#3119)', () => {
|
||||
const keep = (startDate: string, endDate: string, stays: DayGridStay[] = []) =>
|
||||
planDayGrid({ days: tenDays, stays, startDate, endDate, keepDates: true });
|
||||
|
||||
it('a day before the start is a new first day, every other day keeps its date', () => {
|
||||
const p = keep('2026-09-30', '2026-10-10');
|
||||
expect(p.rows[0]).toEqual({ id: null, date: '2026-09-30' });
|
||||
expect(p.rows.slice(1, 11)).toEqual(tenDays.slice(0, 10).map((d) => ({ id: d.id, date: d.date })));
|
||||
expect(ids(p).slice(-1)).toEqual([12]);
|
||||
expect(gone(p)).toEqual(['11:spare']);
|
||||
});
|
||||
|
||||
it('days at both ends keep the middle where it was and add the days after the spare ones', () => {
|
||||
const p = keep('2026-09-28', '2026-10-12');
|
||||
expect(ids(p)).toEqual([null, null, null, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]);
|
||||
expect(p.rows[3]).toEqual({ id: 1, date: '2026-10-01' });
|
||||
expect(p.rows[12]).toEqual({ id: 10, date: '2026-10-10' });
|
||||
expect(p.removed).toEqual([]);
|
||||
});
|
||||
|
||||
it('a later end is laid out as without it', () => {
|
||||
expect(keep('2026-10-01', '2026-10-14')).toEqual(plan('2026-10-01', '2026-10-14'));
|
||||
});
|
||||
|
||||
it('a moved or shorter range does not hold every day, so the days follow their position', () => {
|
||||
for (const [start, end] of [
|
||||
['2026-10-03', '2026-10-10'],
|
||||
['2026-10-01', '2026-10-08'],
|
||||
['2026-10-05', '2026-10-14'],
|
||||
['2026-09-29', '2026-10-09'],
|
||||
] as const) {
|
||||
expect(keep(start, end)).toEqual(plan(start, end));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe('without dates', () => {
|
||||
const undated = (n: number, planned: number[] = [], stays: DayGridStay[] = [], dayCount?: number) =>
|
||||
planDayGrid({
|
||||
|
||||
@@ -175,6 +175,19 @@ const removal = (day: DayGridDay, reason: DayGridRemovalReason): DayGridRemoval
|
||||
const isEmptyDay = (day: DayGridDay, stays: readonly DayGridStay[]): boolean =>
|
||||
!day.hasPlanItems && !stays.some((s) => s.start_day_id === day.id || s.end_day_id === day.id);
|
||||
|
||||
/**
|
||||
* How many new days go before the first dated day so that every dated day keeps
|
||||
* its date: the days between the new start and the first day's date. Zero when
|
||||
* the first day lies before the new start or the dated days would not all fit
|
||||
* into the range from there, which is when the plans have to move.
|
||||
*/
|
||||
function newDaysBefore(dated: readonly DayGridDay[], startDate: string, span: number): number {
|
||||
const first = dated[0]?.date;
|
||||
if (!first || first < startDate) return 0;
|
||||
const lead = tripSpanDays(startDate, first) - 1;
|
||||
return lead + dated.length <= span ? lead : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* The day rows a trip gets for a range, the rule the server writes by
|
||||
* (TripsService.generateDays carries this plan out) and the trip dialog warns
|
||||
@@ -188,6 +201,13 @@ const isEmptyDay = (day: DayGridDay, stays: readonly DayGridStay[]): boolean =>
|
||||
* not. A stay on a dropped dated day goes with that day, so it no longer keeps a
|
||||
* spare day it touched.
|
||||
*
|
||||
* With `keepDates` (bookings keep their dates, the trip dialog's default) a
|
||||
* range that still holds every dated day leaves each of them on its date, and
|
||||
* the new days go around them: a day added before the start is a new empty
|
||||
* first day, not a reason to move every plan a day earlier (#3119). A range
|
||||
* that does not hold them all (the trip moved or got shorter) falls back to
|
||||
* the positional rule above.
|
||||
*
|
||||
* Without dates every day loses its date and the trip is held to `dayCount`
|
||||
* days (its current count when none is given): short of it, empty days are
|
||||
* added at the end; over it, empty days go, the highest numbers first. A day
|
||||
@@ -200,8 +220,9 @@ export function planDayGrid(input: {
|
||||
startDate: string | null | undefined;
|
||||
endDate: string | null | undefined;
|
||||
dayCount?: number;
|
||||
keepDates?: boolean;
|
||||
}): DayGridPlan {
|
||||
const { days, stays, startDate, endDate, dayCount } = input;
|
||||
const { days, stays, startDate, endDate, dayCount, keepDates = false } = input;
|
||||
|
||||
if (!startDate || !endDate) {
|
||||
const ordered = [...days].sort(byDayNumber);
|
||||
@@ -225,11 +246,15 @@ export function planDayGrid(input: {
|
||||
const undated = days.filter((day) => !day.date).sort(byDayNumber);
|
||||
const span = tripSpanDays(startDate, endDate);
|
||||
|
||||
const lead = keepDates ? newDaysBefore(dated, startDate, span) : 0;
|
||||
|
||||
const rows: DayGridRow[] = [];
|
||||
let used = 0;
|
||||
for (let i = 0; i < span; i++) {
|
||||
const date = addIsoDays(startDate, i);
|
||||
if (i < dated.length) rows.push({ id: dated[i]!.id, date });
|
||||
const slot = i - lead;
|
||||
if (slot < 0) rows.push({ id: null, date });
|
||||
else if (slot < dated.length) rows.push({ id: dated[slot]!.id, date });
|
||||
else if (used < undated.length) rows.push({ id: undated[used++]!.id, date });
|
||||
else rows.push({ id: null, date });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user