From 336dacd08d312f49c48d769b3a0cde66a7f4f45f Mon Sep 17 00:00:00 2001 From: Simeon Wong Date: Tue, 20 Feb 2024 10:54:02 -0500 Subject: [PATCH] add initials --- index.html | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index b36677b..1ae46bb 100644 --- a/index.html +++ b/index.html @@ -22,6 +22,9 @@

Expense Parser

Paste in data from My Wallet

+ + +


@@ -50,6 +53,10 @@

Interactive table

}; const parseTextToTable = (input) => { + let initials = document.getElementById('initials').value.toUpperCase(); + initials = initials.length == 0 ? '' : initials + '_'; + + const lines = input.split('\n').filter(line => line.trim() !== ''); const table = []; let currentDate; @@ -67,7 +74,7 @@

Interactive table

const amountInCAD = amounts[1].replace(/,/g, ''); const amountInOriginalCurrency = (amounts[3] ? `${amounts[2]} ${amounts[3]}` : '').replace(/,/g, ''); const dateFormatted = formatDate(currentDate); - const filename = `${dateFormatted}_${expenseName.replace(/[^a-zA-Z0-9.\-_]/g, '')}_${amountInCAD}.pdf`; + const filename = `${initials}${dateFormatted}_${expenseName.replace(/[^a-zA-Z0-9.\-_]/g, '')}_${amountInCAD}.pdf`; table.push([ currentDate.toLocaleDateString('en-CA'),