-
Notifications
You must be signed in to change notification settings - Fork 259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
negative value for age input #1375 #1379
negative value for age input #1375 #1379
Conversation
it is true that there are 12 months but logically it doesn't make any
sense, if someone have completed 12 months it directly means 1 whole year.
so age will increment by one whole year
…On Wed, Jan 8, 2025 at 11:38 PM LEMERI FESTUS ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In frontend/src/components/patient/CreatePatientForm.js
<#1379 (comment)>
:
> id="months"
+ min="0" // Prevent negative months
+ max="11" // Limit months to 0–11
+ onChange={(e) => {
+ let value = parseInt(e.target.value || 0);
+ value = Math.min(11, Math.max(0, value)); // value between 0 and 11
set this to 12 since there are 12 months
—
Reply to this email directly, view it on GitHub
<#1379 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BDRUJK5J2W6YZG24JNSOUQT2JVSQVAVCNFSM6AAAAABU2N4MUGVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDKMZXHA2DONRQGE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Hey Lemeri,
Do we have an update on this?
…On Wed, Jan 8, 2025 at 11:47 PM Yash Goyal ***@***.***> wrote:
it is true that there are 12 months but logically it doesn't make any
sense, if someone have completed 12 months it directly means 1 whole year.
so age will increment by one whole year
On Wed, Jan 8, 2025 at 11:38 PM LEMERI FESTUS ***@***.***>
wrote:
> ***@***.**** commented on this pull request.
> ------------------------------
>
> In frontend/src/components/patient/CreatePatientForm.js
> <#1379 (comment)>
> :
>
> > id="months"
> + min="0" // Prevent negative months
> + max="11" // Limit months to 0–11
> + onChange={(e) => {
> + let value = parseInt(e.target.value || 0);
> + value = Math.min(11, Math.max(0, value)); // value between 0 and 11
>
> set this to 12 since there are 12 months
>
> —
> Reply to this email directly, view it on GitHub
> <#1379 (review)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/BDRUJK5J2W6YZG24JNSOUQT2JVSQVAVCNFSM6AAAAABU2N4MUGVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDKMZXHA2DONRQGE>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
|
placeholder={intl.formatMessage({ | ||
id: "patient.information.days", | ||
})} | ||
/> | ||
<div className="error"> | ||
<ErrorMessage name="birthDateForDisplay"></ErrorMessage> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you remove this error message intentionally ??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nopes should i fix it?
id="days" | ||
min="0" // Prevent negative days | ||
max="30" // Limit days to 0–30 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think you cant hard code 30 as the max days as this varies depensidn on the month
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay will change it to 31 or can make changes to code on month conditions also
max="11" // Limit months to 0–11 | ||
onChange={(e) => { | ||
let value = parseInt(e.target.value || 0); | ||
value = Math.min(11, Math.max(0, value)); // value between 0 and 11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This Logic is already handles
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which line, can you please explain a bit?
👋 Hi, @yashgoyal0110, This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there. |
@mozzy11 do we have some update? |
Thanks @yashgoyal0110 . |
fixes #1375
Issue number if applicable.
documentation.
Summary
Screenshots
[Add relevant screenshots here if applicable]
Related Issue
[Add a link to the related issue or mention it here if applicable]
Other
[Add any additional information or notes here]