powerhouse-inc / design-system

https://design-system-three-lyart.vercel.app
GNU Affero General Public License v3.0
0 stars 1 forks source link

RWA Portfolio: display error if user tries to add/edit maturity asset without time #357

Closed gpuente closed 20 hours ago

gpuente commented 1 week ago

When maturity date is set without time, maturity is saved as null:

https://github.com/user-attachments/assets/08826bda-1e09-4f13-99f0-86f163be2175

gpuente commented 1 week ago

Hey @CallmeT-ty, here is an update about this issue:

This issue occurs when you manually enter the datetime (by typing the date instead of selecting it from the picker). If you don't specify a time, the input is not considered complete, and the onChange event is not triggered. As a result, if the date is entered without a time, it's treated as if no date was entered for the maturity. Since the onChange event isn't emitted, we can't detect whether the user attempted to enter an incomplete date. This behavior is due to the limitations of the native browser datetime picker, which works in most cases but lacks full flexibility. To fix this issue, we need to implement a custom datetime picker that triggers onChange events even when an "incomplete" datetime is entered.

I'll explore this alternative: https://reactdatepicker.com/

CallmeT-ty commented 2 days ago

@gpuente Looks good to me. I was able to create assets without setting a date.

CallmeT-ty commented 20 hours ago

I talked with Teep and apparently this would be the desired behaviour:

IF the asset type = Treasury BIll then Maturity should be compulsory otherwise should be optional

I'll close this issue and make a new one to implement the desired behaviour