Merge branch 'main' into taxi
This commit is contained in:
@@ -16,7 +16,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-else-if="activeTab === 'party'">
|
<div v-else-if="activeTab === 'party'">
|
||||||
<button @click="toggleNewPartyView">
|
<button @click.prevent="toggleNewPartyView()" type="button">
|
||||||
{{ $t('falukant.reputation.party.newpartyview.' + (newPartyView ? 'close' : 'open')) }}
|
{{ $t('falukant.reputation.party.newpartyview.' + (newPartyView ? 'close' : 'open')) }}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
@@ -79,7 +79,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<button @click="orderParty()">
|
<button type="button" @click="orderParty()">
|
||||||
{{ $t('falukant.reputation.party.order') }}
|
{{ $t('falukant.reputation.party.order') }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -106,7 +106,7 @@
|
|||||||
<td>{{ $t('falukant.reputation.party.banquette.' + party.banquetteType.tr) }}</td>
|
<td>{{ $t('falukant.reputation.party.banquette.' + party.banquetteType.tr) }}</td>
|
||||||
<td>{{ party.servantRatio }}</td>
|
<td>{{ party.servantRatio }}</td>
|
||||||
<td>{{ party.cost.toLocaleString($i18n.locale, { minimumFractionDigits: 2, maximumFractionDigits: 2 }) }}</td>
|
<td>{{ party.cost.toLocaleString($i18n.locale, { minimumFractionDigits: 2, maximumFractionDigits: 2 }) }}</td>
|
||||||
<td>{{ new Date(party.createdAt).toLocaleString() }}</td>
|
<td>{{ getPartyDate(party.createdAt).toLocaleString() }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
@@ -133,7 +133,7 @@
|
|||||||
<td>{{ $t('falukant.reputation.party.banquette.' + party.banquetteType.tr) }}</td>
|
<td>{{ $t('falukant.reputation.party.banquette.' + party.banquetteType.tr) }}</td>
|
||||||
<td>{{ party.servantRatio }}</td>
|
<td>{{ party.servantRatio }}</td>
|
||||||
<td>{{ party.cost.toLocaleString($i18n.locale, { minimumFractionDigits: 2, maximumFractionDigits: 2 }) }}</td>
|
<td>{{ party.cost.toLocaleString($i18n.locale, { minimumFractionDigits: 2, maximumFractionDigits: 2 }) }}</td>
|
||||||
<td>{{ new Date(party.createdAt).toLocaleString() }}</td>
|
<td>{{ getPartyDate(party.createdAt).toLocaleString() }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
@@ -186,15 +186,16 @@ export default {
|
|||||||
},
|
},
|
||||||
async loadParties() {
|
async loadParties() {
|
||||||
const { data } = await apiClient.get('/api/falukant/party');
|
const { data } = await apiClient.get('/api/falukant/party');
|
||||||
const yesterday = new Date();
|
const now = new Date();
|
||||||
yesterday.setDate(yesterday.getDate() - 1);
|
const twentyFourHoursAgo = new Date(now.getTime() - 24 * 60 * 60 * 1000);
|
||||||
|
|
||||||
this.inProgressParties = data.filter(party => {
|
this.inProgressParties = data.filter(party => {
|
||||||
const partyDate = new Date(party.createdAt);
|
const partyDate = this.getPartyDate(party.createdAt);
|
||||||
return partyDate > yesterday;
|
return partyDate > twentyFourHoursAgo;
|
||||||
});
|
});
|
||||||
this.completedParties = data.filter(party => {
|
this.completedParties = data.filter(party => {
|
||||||
const partyDate = new Date(party.createdAt);
|
const partyDate = this.getPartyDate(party.createdAt);
|
||||||
return partyDate <= yesterday;
|
return partyDate <= twentyFourHoursAgo;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
async loadNobilityTitles() {
|
async loadNobilityTitles() {
|
||||||
@@ -209,6 +210,12 @@ export default {
|
|||||||
servantRatio: this.servantRatio
|
servantRatio: this.servantRatio
|
||||||
});
|
});
|
||||||
this.toggleNewPartyView();
|
this.toggleNewPartyView();
|
||||||
|
},
|
||||||
|
getPartyDate(createdAt) {
|
||||||
|
// Feste finden 1 Tag nach der Bestellung statt
|
||||||
|
const partyDate = new Date(createdAt);
|
||||||
|
partyDate.setDate(partyDate.getDate() + 1);
|
||||||
|
return partyDate;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|||||||
Reference in New Issue
Block a user