Seaprate date validation contexts and render configured currency - #237
Open
black-dragon74 wants to merge 5 commits into
Open
Seaprate date validation contexts and render configured currency#237black-dragon74 wants to merge 5 commits into
black-dragon74 wants to merge 5 commits into
Conversation
Validate localized form dates strictly while keeping API dates ISO-safe. Signed-off-by: Niraj Yadav <niryadav@redhat.com>
Use configured date formats across maintenance, fuel, compliance, and reminder forms. Signed-off-by: Niraj Yadav <niryadav@redhat.com>
Format fuel spending with the user's currency and locale settings. Signed-off-by: Niraj Yadav <niryadav@redhat.com>
Format expense chart axes and tooltips with the user's currency settings. Signed-off-by: Niraj Yadav <niryadav@redhat.com>
Author
|
@javedh-dev PTAL :) |
javedh-dev
requested changes
Aug 9, 2026
javedh-dev
left a comment
Owner
There was a problem hiding this comment.
Please check The comment below and add a test for same so it also is covered under that.
| const endDate = new Date(data.endDate); | ||
| // Field-level form validation handles localized values; this comparison | ||
| // is for ISO API values only. | ||
| if (Number.isNaN(startDate.getTime()) || Number.isNaN(endDate.getTime())) return true; |
Owner
There was a problem hiding this comment.
This refine is still comparing localized date strings with new Date(), not ISO ones. The NaN check doesn't save it — for day/month both ≤12 it'll parse fine, just as the wrong date (US order). So startDate: '10/03/2026' + endDate: '03/10/2026' (a totally valid range) gets rejected because it reads them backwards.
Can we drop this comparison from the schema the form uses, or give the form its own version that actually parses with dateFormat?
Signed-off-by: Niraj Yadav <niryadav@redhat.com>
This was referenced Aug 13, 2026
Open
Author
|
Hey @javedh-dev, can we get this in? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thank you for this amazing project!!
This patch fixes date validation for configured formats like dd/MM/yyyy across forms, including invalid dates and date ranges. I have added regression tests around the same. Without this you could not set dates where day is above 12.
This patch also updates fuel “Total Spent” and charts to use the configured currency instead of always showing
$.