Changeset View
Changeset View
Standalone View
Standalone View
src/resources/vue/Widgets/TransactionLog.vue
Show First 20 Lines • Show All 105 Lines • ▼ Show 20 Lines | export default { | ||||
return this.$root.price(transaction.amount) | return this.$root.price(transaction.amount) | ||||
}, | }, | ||||
className(transaction) { | className(transaction) { | ||||
return transaction.amount < 0 ? 'text-danger' : 'text-success'; | return transaction.amount < 0 ? 'text-danger' : 'text-success'; | ||||
}, | }, | ||||
description(transaction) { | description(transaction) { | ||||
let desc = transaction.description | let desc = transaction.description | ||||
if(transaction.period_start && transaction.period_end) { | |||||
machniak: Missing space. | |||||
Not Done Inline ActionsNot done. Missing space after if. machniak: Not done. Missing space after `if`. | |||||
let from = new Date(transaction.period_start) | |||||
Not Done Inline ActionsI think we should use Laravel's type casting https://laravel.com/docs/6.x/eloquent-mutators#date-casting machniak: I think we should use Laravel's type casting https://laravel.com/docs/6.x/eloquent… | |||||
let till = new Date(transaction.period_end) | |||||
desc += ' (' + from.toLocaleDateString() + ' - ' + till.toLocaleDateString() + ')' | |||||
Not Done Inline ActionsWhat if this is the same day? Should we display that differently? Should we display additional "X days" text? machniak: What if this is the same day? Should we display that differently? Should we display additional… | |||||
} | |||||
if (/^(billed|created|deleted)$/.test(transaction.type)) { | if (/^(billed|created|deleted)$/.test(transaction.type)) { | ||||
desc += ' (' + this.$root.price(transaction.amount) + ')' | desc += ' (' + this.$root.price(transaction.amount) +')' | ||||
} | } | ||||
return desc | return desc | ||||
} | } | ||||
} | } | ||||
} | } | ||||
</script> | </script> |
Missing space.