diff --git a/app/Transformers/V2/TransactionGroupTransformer.php b/app/Transformers/V2/TransactionGroupTransformer.php index 86aba03780..20b88d7485 100644 --- a/app/Transformers/V2/TransactionGroupTransformer.php +++ b/app/Transformers/V2/TransactionGroupTransformer.php @@ -31,6 +31,7 @@ use FireflyIII\Models\TransactionType; use FireflyIII\Support\Http\Api\ConvertsExchangeRates; use FireflyIII\Support\NullArrayObject; use Illuminate\Support\Collection; +use Illuminate\Support\Facades\Log; /** * Class TransactionGroupTransformer @@ -261,6 +262,10 @@ class TransactionGroupTransformer extends AbstractTransformer if (null === $string) { 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')); } } diff --git a/frontend/src/components/dashboard/BudgetBox.vue b/frontend/src/components/dashboard/BudgetBox.vue index 7ea813ccdf..9be3af1705 100644 --- a/frontend/src/components/dashboard/BudgetBox.vue +++ b/frontend/src/components/dashboard/BudgetBox.vue @@ -41,9 +41,9 @@
- {{ limit.amount }}
- {{ limit.start }}
- {{ limit.end }} + {{ formatAmount(limit.currency_code, limit.amount) }}
+ {{ formatDate(limit.start) }}
+ {{ formatDate(limit.end) }}
I am bar @@ -67,6 +67,7 @@ import {useFireflyIIIStore} from "../../stores/fireflyiii"; import List from '../../api/v2/budgets/list'; import ListLimit from '../../api/v2/budget-limits/list'; +import format from "date-fns/format"; export default { name: "BudgetBox", @@ -75,11 +76,13 @@ export default { budgets: [], locale: 'en-US', page: 1, - loadingBudgets: false + loadingBudgets: false, + dateFormat: '', } }, mounted() { this.store = useFireflyIIIStore(); + this.dateFormat = this.$t('config.month_and_day_fns'); this.store.$onAction( ({name, store, args, after, onError,}) => { after((result) => { @@ -95,6 +98,12 @@ export default { } }, 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 () { this.loadingBudgets = true; (new List).list(this.page).then((data) => { @@ -145,12 +154,14 @@ export default { budget.limits.push( { amount: current.attributes.amount, + currency_code: current.attributes.currency_code, start: new Date(current.attributes.start), end: new Date(current.attributes.end), } ); - console.log('A ' + new Date(current.attributes.start)); - console.log('B ' + this.store.getRange.start); + console.log(current); + //console.log('A ' + new Date(current.attributes.start)); + //console.log('B ' + this.store.getRange.start); } } } diff --git a/frontend/src/components/dashboard/TransactionList.vue b/frontend/src/components/dashboard/TransactionList.vue index 9aa42ca9ff..0189b5afac 100644 --- a/frontend/src/components/dashboard/TransactionList.vue +++ b/frontend/src/components/dashboard/TransactionList.vue @@ -42,7 +42,7 @@ - + {{ transaction.transactionGroupTitle }}
@@ -52,7 +52,7 @@ {{ tr.description }}
- {{ tr.description }} @@ -66,7 +66,7 @@
- + {{ tr.destination_name }}
diff --git a/frontend/src/pages/development/Index.vue b/frontend/src/pages/development/Index.vue index 5a8406d28b..4d24ccff4a 100644 --- a/frontend/src/pages/development/Index.vue +++ b/frontend/src/pages/development/Index.vue @@ -66,9 +66,9 @@ future. Until then, please leave your feedback here:

Thanks again,