ng-matero / extensions

Angular Material Extensions Library.
https://ng-matero.github.io/extensions/
MIT License
445 stars 60 forks source link

DateTimePicker: Min Date is not validated correctly #344

Open desmondblue opened 2 months ago

desmondblue commented 2 months ago

Thanks for the repository In DateTimePicker for the type "date" the minimum date is not getting validated correctly. The current validation validates the actual date vs the minimum date(timestamp) now due to this additional timestamp comparisson to a date without timestamp. The validations fails to go through and we get an error.

I am currently using the latest v17 extensions library.

mtxDatetimepickerMin 
{min: Moment, actual: Moment}
actual
: 
Moment {_isAMomentObject: true, _i: '2024-09-12', _f: 'YYYY-MM-DD', _isUTC: false, _pf: {…}, …}
min
: 
Moment {_isAMomentObject: true, _i: '2024-09-12T12:53:13.009Z', _f: 'YYYY-MM-DDTHH:mm:ss.SSSSZ', _tzm: 0, _isUTC: false, …}
[[Prototype]]
: 
Object

A suggestion would be to do the min and max date validation based on the type of the input selected.

nzbin commented 2 months ago

Can you provide an online demo?