Is there a better way to do this data formatting

I am working on an application that needs to plug into an accounting system. I accountancy for a business in my country, each company has a different tax or vat year end, so in my case this company has their year end on the last day of September.

With this in mind, my application is writing a csv file that needs to be imported into their accounting program, and when the invoice is processed in July I need to show that July which is the 7th month is actually the accountancy period of 10.

I have done this with a data formatter but im pretty sure there must me a better way.

{{serverconnect_invoice_main.data.query_invoice_main[0].inv_date.formatDate("MMMM").replace('January','4').replace('February','5').replace('March','6').replace('April','7').replace('May','8').replace('June','9').replace('July','10').replace('August','11').replace('September','12').replace('October','1').replace('November','2').replace('December','3')}}
Community Page
Last updated: