DONE: add flexible json update saham, yuran, and pelaburan ui
This commit is contained in:
@@ -439,10 +439,16 @@ export default {
|
||||
]
|
||||
},
|
||||
{
|
||||
key: "pelaburan",
|
||||
icon: "fa-bank",
|
||||
label: "Simpanan Khas (Tabung 1) - (Sehingga Dis 2025)",
|
||||
value: "RM " + fmt(u.accumulated_amount),
|
||||
subvalue: dividendSub(u.accumulated_amount, u.pelaburan, 12)
|
||||
label: "Pelaburan Simpanan Khas (Tabung 1) - (Sehingga Dis 2025)",
|
||||
value: "RM " + fmt(u.pelaburan),
|
||||
subvalue: dividendSub(u.pelaburan, u.dividen_pelaburan, 12)
|
||||
},
|
||||
{
|
||||
icon: "fa-bank",
|
||||
label: "Pelaburan Simpanan Khas (Tabung 2) - (Sehingga " + this.formatMalayMonthYear() + ")",
|
||||
value: "RM " + fmt(u.pelaburan_2),
|
||||
}
|
||||
];
|
||||
}
|
||||
@@ -460,6 +466,20 @@ export default {
|
||||
},
|
||||
|
||||
methods: {
|
||||
/**
|
||||
* Malay short month + year for "Sehingga …" labels (defaults to previous month).
|
||||
*/
|
||||
formatMalayMonthYear(date) {
|
||||
const d = date ? new Date(date) : new Date();
|
||||
// End of previous calendar month
|
||||
d.setDate(0);
|
||||
const months = [
|
||||
"Jan", "Feb", "Mac", "Apr", "Mei", "Jun",
|
||||
"Jul", "Ogo", "Sep", "Okt", "Nov", "Dis"
|
||||
];
|
||||
return months[d.getMonth()] + " " + d.getFullYear();
|
||||
},
|
||||
|
||||
async fetchPortalSettings() {
|
||||
try {
|
||||
this.util.setAuthorization();
|
||||
|
||||
Reference in New Issue
Block a user