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