-
Notifications
You must be signed in to change notification settings - Fork 97
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
Please support DateOnly
params in constructors of sub view models or support it for MinDate property of the bp:DatePicker control
#1791
Comments
The is that the matching property is of type DateTime. It should work if you also change it to DateOnly
Mar 3, 2024 18:43:09 liviriniu ***@***.***>:
…
Hi,
Currently it crashes if I use a *DateOnly* parameter in a primary constructor for a sub view model.
The primary constructor:
image.png (view on web)[https://github.com/riganti/dotvvm/assets/63544057/09f12b25-6b26-4828-ab4b-17efe0c012b6]
The crash log:
image.png (view on web)[https://github.com/riganti/dotvvm/assets/63544057/bc7898c9-e829-47b7-b1de-7a159378cd55]
—
Reply to this email directly, view it on GitHub[#1791], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AB4HNH22QBKDJA4TAXRVOC3YWNOKPAVCNFSM6AAAAABEEEAYYOVHI2DSMVQWIX3LMV43ASLTON2WKOZSGE3DKNBWGY4TINA].
You are receiving this because you are subscribed to this thread.
[Tracking image][https://github.com/notifications/beacon/AB4HNH3BAO4FK6MRQ6ODXRLYWNOKPA5CNFSM6AAAAABEEEAYYOWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHICETHIA.gif]
|
Yeees, sure. But... sigh 😿 |
DateOnly
params in constructors of sub view modelsDateOnly
params in constructors of sub view models or support it for MinDate property of the bp:DatePicker control
It wouldn't be hard to add support for the ToDateTime method, but can't you simply change the constructor argument to DateTime? DateTime->DateOnly isn't even implicitly convertible, so the serializer fails legitimately. (however, BP:DatePicker should just work with DateOnly) |
BP:DatePicker simply crashes if I use DateOnly
Sure, this is how I currently go about because I have no choice. I can live with this because although the business logic/layer uses DateOnly as best practice / standard, the points of conversion are small and can get smaller (by encapsulating in an extension method): |
Hi,
Currently it crashes if I use a
DateOnly
parameter in a primary constructor for a sub view model.The primary constructor:
The crash log:
The text was updated successfully, but these errors were encountered: