Aman-Mittal opened a new issue, #226:
URL: https://github.com/apache/fineract-backoffice-ui/issues/226
## What happens
On the 1st through the 9th of any month, saving anything that carries a date
fails with a **500** and the generic failure toast. From the 10th onward the
same form works. `formatDateToFineract` is used by **39 files**, so this covers
staff creation, loan and savings account creation, disbursement, repayment,
interest pauses, post-dated checks, journal entries — essentially every dated
write in the application.
## Why
`src/app/core/utils/date-formatter.ts` builds the day without padding:
```ts
const day = d.getDate(); // 2, not "02"
return `${day} ${month} ${year}`; // "2 August 2026"
```
Every caller sends that value alongside `FINERACT_DATE_FORMAT`:
```ts
export const FINERACT_DATE_FORMAT = 'dd MMMM yyyy';
```
`dd` means two digits. Fineract parses the value strictly against the format
it is told to use, so an unpadded day does not fail validation with a readable
message — it fails to parse, and the request comes back as an unhandled 500.
Verified against a live instance, changing only the day padding:
```
joiningDate='2 August 2026' -> HTTP 500
joiningDate='02 August 2026' -> HTTP 200
```
## Business value
This makes the application unusable for dated work on roughly a third of the
calendar, including the 1st of the month — which for a lending institution is
one of the busiest days there is, when disbursements, repayments and
month-start bookings land. The failure is silent about its cause: the toast
says only "Operation failed", the date on screen looks perfectly valid, and
retrying or re-picking the date changes nothing. Staff have no way to discover
that the workaround is to wait until the 10th.
It also fails in the most damaging possible direction. A user in the middle
of a repayment or disbursement gets an error, cannot tell whether the
transaction was recorded, and the natural response is to try again.
## Why it was not caught
`date-formatter.spec.ts` only ever exercised the 15th of the month:
```ts
expect(formatDateToFineract(new Date(2026, 0, 15))).toBe('15 January 2026');
```
Two component specs then asserted the unpadded output as expected payload
(`startDate: '1 January 2026'`, `date: '1 January 2026'`), pinning the bug in
place as intended behaviour. The mocked e2e suite cannot catch it either, since
no mock parses the date.
## Fix
Zero-pad the day, add coverage for single-digit days and for the invariant
that the formatter's output matches the format string it is always sent with,
and correct the two specs that asserted the broken output.
## How it was found
By driving the UI end to end against a real backend with no API seeding —
the create-staff step of a savings demo would not go through. Today happens to
be the 2nd.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]