generated from dave/wails-template
Make formatting a bit more better
Display dates for months in view
This commit is contained in:
@@ -1,12 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
|
||||
<meta charset="UTF-8" />
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
|
||||
<title>wails-template</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script src="./src/main.ts" type="module"></script>
|
||||
<div id="app"></div>
|
||||
<script src="./src/main.ts" type="module"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
</html>
|
@@ -17,7 +17,7 @@
|
||||
<svelte:window on:keydown={keyDown} />
|
||||
<Toaster theme="dark" expand visibleToasts={9} />
|
||||
<template>
|
||||
<Header />
|
||||
<!-- <Header /> -->
|
||||
<main class="flex-1">
|
||||
<Router />
|
||||
</main>
|
||||
|
@@ -11,7 +11,5 @@
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<p>{paymentBill.name}</p>
|
||||
</div>
|
||||
<p>{paymentBill.name}</p>
|
||||
</template>
|
||||
|
@@ -6,6 +6,12 @@
|
||||
import PaymentBillComp from "./PaymentBillComp.svelte";
|
||||
|
||||
export let payments: main.Payment[] = [];
|
||||
export let date: Date = new Date();
|
||||
let dateString: string = date.toISOString()
|
||||
$: {
|
||||
dateString = date.toISOString().split("T")[0]
|
||||
dateString = dateString.split("-").slice(0, 2).join("-");
|
||||
}
|
||||
|
||||
const paymentsModel: { [key: number]: PaymentBill } = {};
|
||||
for (const bill of $billsStore) {
|
||||
@@ -30,9 +36,14 @@
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
{#each Object.values(paymentsModel) as payment}
|
||||
<PaymentBillComp paymentBill={payment} />
|
||||
{/each}
|
||||
<div class="border-double border-2 border-gray-500 m-1">
|
||||
<div class="text-4xl font-bold">
|
||||
{dateString}
|
||||
</div>
|
||||
<div>
|
||||
{#each Object.values(paymentsModel) as payment}
|
||||
<PaymentBillComp paymentBill={payment} />
|
||||
{/each}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
@@ -1,12 +1,18 @@
|
||||
<script lang="ts">
|
||||
import Payments from "$lib/components/Payments.svelte";
|
||||
import { nowStore } from "$lib/store/nowStore";
|
||||
import { lastMonthPaymentsStore } from "$lib/store/lastMonthPaymentsStore";
|
||||
import { thisMonthPaymentsStore } from "$lib/store/thisMonthPaymentsStore";
|
||||
|
||||
|
||||
const thisMonth = new Date();
|
||||
thisMonth.setMonth($nowStore.getMonth());
|
||||
const previousMonth = new Date();
|
||||
previousMonth.setMonth($nowStore.getMonth() - 1);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Payments payments={$thisMonthPaymentsStore} />
|
||||
<Payments payments={$lastMonthPaymentsStore} />
|
||||
</template>
|
||||
<div class="grid grid-cols-2">
|
||||
<Payments date={previousMonth} payments={$lastMonthPaymentsStore} />
|
||||
<Payments date={thisMonth} payments={$thisMonthPaymentsStore} />
|
||||
</div>
|
||||
</template>
|
||||
|
Reference in New Issue
Block a user