mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-12-25 08:21:08 -06:00
Some small fixes in UI
This commit is contained in:
parent
9fdaf1cee8
commit
cc218e203f
@ -31,6 +31,7 @@ use FireflyIII\Models\TransactionType;
|
|||||||
use FireflyIII\Support\Http\Api\ConvertsExchangeRates;
|
use FireflyIII\Support\Http\Api\ConvertsExchangeRates;
|
||||||
use FireflyIII\Support\NullArrayObject;
|
use FireflyIII\Support\NullArrayObject;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class TransactionGroupTransformer
|
* Class TransactionGroupTransformer
|
||||||
@ -261,6 +262,10 @@ class TransactionGroupTransformer extends AbstractTransformer
|
|||||||
if (null === $string) {
|
if (null === $string) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return Carbon::createFromFormat('Y-m-d', $string);
|
Log::debug(sprintf('Now in date("%s")', $string));
|
||||||
|
if(10 === strlen($string)) {
|
||||||
|
return Carbon::createFromFormat('Y-m-d', $string, config('app.timezone'));
|
||||||
|
}
|
||||||
|
return Carbon::createFromFormat('Y-m-d H:i:s', $string, config('app.timezone'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,9 +41,9 @@
|
|||||||
<div v-for="limit in budget.limits">
|
<div v-for="limit in budget.limits">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<small>{{ limit.amount }}</small><br>
|
<small>{{ formatAmount(limit.currency_code, limit.amount) }}</small><br>
|
||||||
{{ limit.start }}<br>
|
{{ formatDate(limit.start) }}<br>
|
||||||
{{ limit.end }}
|
{{ formatDate(limit.end) }}
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
I am bar
|
I am bar
|
||||||
@ -67,6 +67,7 @@
|
|||||||
import {useFireflyIIIStore} from "../../stores/fireflyiii";
|
import {useFireflyIIIStore} from "../../stores/fireflyiii";
|
||||||
import List from '../../api/v2/budgets/list';
|
import List from '../../api/v2/budgets/list';
|
||||||
import ListLimit from '../../api/v2/budget-limits/list';
|
import ListLimit from '../../api/v2/budget-limits/list';
|
||||||
|
import format from "date-fns/format";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "BudgetBox",
|
name: "BudgetBox",
|
||||||
@ -75,11 +76,13 @@ export default {
|
|||||||
budgets: [],
|
budgets: [],
|
||||||
locale: 'en-US',
|
locale: 'en-US',
|
||||||
page: 1,
|
page: 1,
|
||||||
loadingBudgets: false
|
loadingBudgets: false,
|
||||||
|
dateFormat: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.store = useFireflyIIIStore();
|
this.store = useFireflyIIIStore();
|
||||||
|
this.dateFormat = this.$t('config.month_and_day_fns');
|
||||||
this.store.$onAction(
|
this.store.$onAction(
|
||||||
({name, store, args, after, onError,}) => {
|
({name, store, args, after, onError,}) => {
|
||||||
after((result) => {
|
after((result) => {
|
||||||
@ -95,6 +98,12 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
formatDate: function (date) {
|
||||||
|
return format(new Date(date), this.$t('config.month_and_day_fns'));
|
||||||
|
},
|
||||||
|
formatAmount: function (currencyCode, amount) {
|
||||||
|
return Intl.NumberFormat('en-US', {style: 'currency', currency: currencyCode}).format(amount);
|
||||||
|
},
|
||||||
loadBox: function () {
|
loadBox: function () {
|
||||||
this.loadingBudgets = true;
|
this.loadingBudgets = true;
|
||||||
(new List).list(this.page).then((data) => {
|
(new List).list(this.page).then((data) => {
|
||||||
@ -145,12 +154,14 @@ export default {
|
|||||||
budget.limits.push(
|
budget.limits.push(
|
||||||
{
|
{
|
||||||
amount: current.attributes.amount,
|
amount: current.attributes.amount,
|
||||||
|
currency_code: current.attributes.currency_code,
|
||||||
start: new Date(current.attributes.start),
|
start: new Date(current.attributes.start),
|
||||||
end: new Date(current.attributes.end),
|
end: new Date(current.attributes.end),
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
console.log('A ' + new Date(current.attributes.start));
|
console.log(current);
|
||||||
console.log('B ' + this.store.getRange.start);
|
//console.log('A ' + new Date(current.attributes.start));
|
||||||
|
//console.log('B ' + this.store.getRange.start);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="transaction in transactions">
|
<tr v-for="transaction in transactions">
|
||||||
<td class="text-left">
|
<td class="text-left">
|
||||||
<router-link :to="{ name: 'transactions.show', params: {id: transaction.transactionGroupId} }">
|
<router-link :class="$q.dark.isActive ? 'text-red' : 'text-blue'" :to="{ name: 'transactions.show', params: {id: transaction.transactionGroupId} }">
|
||||||
<strong v-if="transaction.transactions.length > 1">
|
<strong v-if="transaction.transactions.length > 1">
|
||||||
{{ transaction.transactionGroupTitle }}<br/>
|
{{ transaction.transactionGroupTitle }}<br/>
|
||||||
</strong>
|
</strong>
|
||||||
@ -52,7 +52,7 @@
|
|||||||
{{ tr.description }}
|
{{ tr.description }}
|
||||||
<br/>
|
<br/>
|
||||||
</span>
|
</span>
|
||||||
<router-link v-if="transaction.transactions.length === 1"
|
<router-link :class="$q.dark.isActive ? 'text-red' : 'text-blue'" v-if="transaction.transactions.length === 1"
|
||||||
:to="{ name: 'transactions.show', params: {id: transaction.transactionGroupId} }">
|
:to="{ name: 'transactions.show', params: {id: transaction.transactionGroupId} }">
|
||||||
{{ tr.description }}
|
{{ tr.description }}
|
||||||
</router-link>
|
</router-link>
|
||||||
@ -66,7 +66,7 @@
|
|||||||
<span v-if="transaction.transactions.length > 1"><br></span>
|
<span v-if="transaction.transactions.length > 1"><br></span>
|
||||||
<span v-for="tr in transaction.transactions">
|
<span v-for="tr in transaction.transactions">
|
||||||
|
|
||||||
<router-link :to="{ name: 'accounts.show', params: {id: tr.destination_id} }">
|
<router-link :class="$q.dark.isActive ? 'text-red' : 'text-blue'" :to="{ name: 'accounts.show', params: {id: tr.destination_id} }">
|
||||||
{{ tr.destination_name }}
|
{{ tr.destination_name }}
|
||||||
</router-link>
|
</router-link>
|
||||||
<br v-if="transaction.transactions.length > 1"/>
|
<br v-if="transaction.transactions.length > 1"/>
|
||||||
|
@ -66,9 +66,9 @@
|
|||||||
future. Until then, please leave your feedback here:
|
future. Until then, please leave your feedback here:
|
||||||
</p>
|
</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="https://github.com/firefly-iii/firefly-iii/discussions/5589">GitHub discussion</a></li>
|
<li><a :class="$q.dark.isActive ? 'text-red' : 'text-blue'" href="https://github.com/firefly-iii/firefly-iii/discussions/5589">GitHub discussion</a></li>
|
||||||
<li><a href="https://gitter.im/firefly-iii/firefly-iii">Gitter.im chat</a></li>
|
<li><a :class="$q.dark.isActive ? 'text-red' : 'text-blue'" href="https://gitter.im/firefly-iii/firefly-iii">Gitter.im chat</a></li>
|
||||||
<li><a href="mailto:james@firefly-iii.org">james@firefly-iii.org</a></li>
|
<li><a :class="$q.dark.isActive ? 'text-red' : 'text-blue'" href="mailto:james@firefly-iii.org">james@firefly-iii.org</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>
|
<p>
|
||||||
Thanks again,<br>
|
Thanks again,<br>
|
||||||
|
Loading…
Reference in New Issue
Block a user