vaidikgarg-bit opened a new pull request, #830: URL: https://github.com/apache/fineract-backoffice-ui/pull/830
## What and why The client record showed its two date-only fields, Activation Date and Submitted, as midnight timestamps with a time zone (`Jan 2, 2025, 12:00:00 AM GMT+5:30`). Fineract stores both as local dates, so the time and zone came from the browser and changed with the viewer's machine. Both fields now use `appIsoDate`, the existing date-only pipe, in place of `dateTime`. `appIsoDate` read only `YYYY-MM-DD` strings; it now also reads Fineract's `[year, month, day]` array and builds the date from the numbers with the local-time constructor. Passing the array to `new Date()` happens to work in Chrome and Node, because V8 parses `"2025,1,2"` as a local date, but that parsing isn't standard and other engines need not do it. The client record's dates now print the same way as the loan record's (`toLocaleDateString()`). That means they follow the browser's locale rather than the language picked in the app, which `dateTime` used, and the style goes from "May 30, 2026" to the short numeric form. Making date-only values follow the in-app language belongs with the shared formatter below. The array handling goes in the pipe because there is no client adapter yet: `client-view` reads `ClientService` directly, so there is no mapper to run `toIsoFineractDate()` in. Like `toIsoFineractDate()`, the pipe checks that the three parts are numbers, and once a client adapter exists it can hand the pipe ISO strings without changes here. A client with no activation or submitted date now shows `—` (the pipe's empty value) where it showed nothing before. `dateTime` is unchanged; its remaining users (audit log, scheduler jobs) show real timestamps. I kept this to the client record. The issue also suggests one shared formatter for every record screen that follows the tenant's date format. That touches more screens and probably needs a decision on tenant vs. browser locale, so I've left it for a follow-up. If you'd rather keep #748 open for that part, I'm happy to switch `Closes` to `Refs`. Closes #748 ## Verification - New `iso-date.pipe.test.ts`: the array and string forms give the same calendar date, no time or zone appears in the output, and short arrays, non-numeric arrays, empty values and unparseable strings give `—`. - New test in `client-view.component.test.ts` checking the rendered Activation Date and Submitted values. Against `main` it fails with `expected 'May 30, 2026, 12:00:00 AM GMT+5:30' to be '5/30/2026'`, and it passes with this change. - `npm test -- --watch=false`: 315 files, 2597 tests pass (also with `TZ=America/New_York`, as CI runs), and the touched specs also pass with `TZ` set to UTC, America/Los_Angeles, America/New_York and Asia/Kolkata. - `npm run lint` (no new warnings), `npx prettier --check` on the changed files, `npm run build`, `npm run check:icons`, `npm run i18n:check`, `./scripts/check-license.sh`: all pass. - Unit tests and mocks only. I didn't run the Playwright specs or exercise it against a real Fineract backend. ## Screenshots Not included; the component test above covers the rendered value. ## Checklist - [x] I did not hand-edit generated files under `src/app/api/`. - [x] New component or service code uses the adapter boundary in `src/app/core/adapters/` instead of direct browser globals or imperative third-party APIs. (No new component or service code.) - [x] User-facing strings use translation keys. (No new strings.) - [x] I added or updated tests appropriate to this change, or explained why tests were not needed. - [ ] UI workflow changes include suitable e2e coverage, including real-backend testing where relevant. (Display-only change, no workflow change; covered by unit tests.) - [ ] Commits are signed — see [Commit Signing](CONTRIBUTING.md#commit-signing) in CONTRIBUTING.md. - [x] I followed the [AI-assisted contributions guidance](CONTRIBUTING.md#ai-assisted-contributions). - [x] If this adds a feature or changes a workflow, I raised it on [[email protected]](https://lists.apache.org/[email protected]) first — or it is a bug fix, refactor or test change, where that does not apply. -- 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]
