mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Build frontend again, using Yarn.
This commit is contained in:
parent
60339c9d1b
commit
ce51bb8be6
4
frontend/src/bootstrap.js
vendored
4
frontend/src/bootstrap.js
vendored
@ -43,9 +43,9 @@ if (token) {
|
||||
let localeToken = document.head.querySelector('meta[name="locale"]');
|
||||
|
||||
if (localeToken) {
|
||||
window.localeValue = localeToken.content;
|
||||
localStorage.locale = localeToken.content;
|
||||
} else {
|
||||
window.localeValue = 'en_US';
|
||||
localStorage.locale = 'en_US';
|
||||
}
|
||||
|
||||
// admin stuff
|
||||
|
@ -25,6 +25,7 @@
|
||||
return {
|
||||
dataSet: null,
|
||||
newDataSet: null,
|
||||
locale: localStorage.local,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -142,7 +143,7 @@
|
||||
for (let labelKey in dataSet.labels) {
|
||||
if (dataSet.labels.hasOwnProperty(labelKey)) {
|
||||
const unixTimeZero = Date.parse(dataSet.labels[labelKey]);
|
||||
dataSet.labels[labelKey] = new Intl.DateTimeFormat(window.localeValue).format(unixTimeZero);
|
||||
dataSet.labels[labelKey] = new Intl.DateTimeFormat(this.locale).format(unixTimeZero);
|
||||
}
|
||||
}
|
||||
return dataSet;
|
||||
|
@ -83,7 +83,7 @@
|
||||
callback: function (tickValue) {
|
||||
"use strict";
|
||||
let currencyCode = this.chart.data.datasets[0] ? this.chart.data.datasets[0].currency_code : 'EUR';
|
||||
return new Intl.NumberFormat(window.localeValue, {style: 'currency', currency: currencyCode}).format(tickValue);
|
||||
return new Intl.NumberFormat(localStorage.locale, {style: 'currency', currency: currencyCode}).format(tickValue);
|
||||
},
|
||||
|
||||
}
|
||||
@ -95,7 +95,7 @@
|
||||
label: function (tooltipItem, data) {
|
||||
"use strict";
|
||||
let currencyCode = data.datasets[tooltipItem.datasetIndex] ? data.datasets[tooltipItem.datasetIndex].currency_code : 'EUR';
|
||||
let nrString = new Intl.NumberFormat(window.localeValue, {
|
||||
let nrString = new Intl.NumberFormat(localStorage.locale, {
|
||||
style: 'currency',
|
||||
currency: currencyCode
|
||||
}).format(tooltipItem.yLabel);
|
||||
|
@ -106,7 +106,7 @@ export default {
|
||||
// date format
|
||||
let dateObj = new Date(value);
|
||||
let options = { year: 'numeric', month: 'long', day: 'numeric' };
|
||||
let str = new Intl.DateTimeFormat(window.localeValue, options).format(dateObj);
|
||||
let str = new Intl.DateTimeFormat(localStorage.locale, options).format(dateObj);
|
||||
//console.log();
|
||||
//return self.formatLabel(value, 20);
|
||||
return self.formatLabel(str, 20);
|
||||
@ -120,7 +120,7 @@ export default {
|
||||
callback: function (tickValue) {
|
||||
"use strict";
|
||||
let currencyCode = this.chart.data.datasets[0].currency_code ? this.chart.data.datasets[0].currency_code : 'EUR';
|
||||
return new Intl.NumberFormat(window.localeValue, {style: 'currency', currency: currencyCode}).format(tickValue);
|
||||
return new Intl.NumberFormat(localStorage.locale, {style: 'currency', currency: currencyCode}).format(tickValue);
|
||||
},
|
||||
beginAtZero: true
|
||||
}
|
||||
@ -134,7 +134,7 @@ export default {
|
||||
"use strict";
|
||||
let currencyCode = data.datasets[tooltipItem.datasetIndex].currency_code ? data.datasets[tooltipItem.datasetIndex].currency_code : 'EUR';
|
||||
let nrString =
|
||||
new Intl.NumberFormat(window.localeValue, {style: 'currency', currency: currencyCode}).format(tooltipItem.yLabel)
|
||||
new Intl.NumberFormat(localStorage.locale, {style: 'currency', currency: currencyCode}).format(tooltipItem.yLabel)
|
||||
|
||||
return data.datasets[tooltipItem.datasetIndex].label + ': ' + nrString;
|
||||
}
|
||||
|
@ -30,7 +30,7 @@
|
||||
<tbody>
|
||||
<tr v-for="transaction in this.transactions">
|
||||
<td>
|
||||
<a :href="'transactions/show/' + transaction.id " :title="transaction.date">
|
||||
<a :href="'transactions/show/' + transaction.id " :title="new Intl.DateTimeFormat(locale, { year: 'numeric', month: 'long', day: 'numeric' }).format(new Date(transaction.attributes.transactions[0].date))">
|
||||
<span v-if="transaction.attributes.transactions.length > 1">{{ transaction.attributes.group_title }}</span>
|
||||
<span v-if="1===transaction.attributes.transactions.length">{{ transaction.attributes.transactions[0].description }}</span>
|
||||
</a>
|
||||
@ -38,16 +38,16 @@
|
||||
<td style="text-align:right;">
|
||||
<span v-for="tr in transaction.attributes.transactions">
|
||||
<span v-if="'withdrawal' === tr.type" class="text-danger">
|
||||
{{ Intl.NumberFormat('en-US', {style: 'currency', currency: tr.currency_code}).format(tr.amount * -1)}}<br>
|
||||
{{ Intl.NumberFormat(locale, {style: 'currency', currency: tr.currency_code}).format(tr.amount * -1) }}<br>
|
||||
</span>
|
||||
<span v-if="'deposit' === tr.type" class="text-success">
|
||||
{{ Intl.NumberFormat('en-US', {style: 'currency', currency: tr.currency_code}).format(tr.amount)}}<br>
|
||||
{{ Intl.NumberFormat(locale, {style: 'currency', currency: tr.currency_code}).format(tr.amount) }}<br>
|
||||
</span>
|
||||
<span v-if="'transfer' === tr.type && tr.source_id === account_id" class="text-info">
|
||||
{{ Intl.NumberFormat('en-US', {style: 'currency', currency: tr.currency_code}).format(tr.amount * -1)}}<br>
|
||||
{{ Intl.NumberFormat(locale, {style: 'currency', currency: tr.currency_code}).format(tr.amount * -1) }}<br>
|
||||
</span>
|
||||
<span v-if="'transfer' === tr.type && tr.destination_id === account_id" class="text-info">
|
||||
{{ Intl.NumberFormat('en-US', {style: 'currency', currency: tr.currency_code}).format(tr.amount)}}<br>
|
||||
{{ Intl.NumberFormat(locale, {style: 'currency', currency: tr.currency_code}).format(tr.amount) }}<br>
|
||||
</span>
|
||||
</span>
|
||||
</td>
|
||||
@ -59,6 +59,16 @@
|
||||
<script>
|
||||
export default {
|
||||
name: "TransactionListSmall",
|
||||
data() {
|
||||
return {
|
||||
locale: 'en-US'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.locale = localStorage.locale ?? 'en-US';
|
||||
},
|
||||
methods: {
|
||||
},
|
||||
props: {
|
||||
transactions: {
|
||||
type: Array,
|
||||
|
2
public/v2/js/vendor.js
vendored
2
public/v2/js/vendor.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user