microsoft / fluentui-blazor

Microsoft Fluent UI Blazor components library. For use with ASP.NET Core Blazor applications
https://www.fluentui-blazor.net
MIT License
3.65k stars 349 forks source link

feat: add different types to FluentDatePicker #2439

Open MarvinKlein1508 opened 1 month ago

MarvinKlein1508 commented 1 month ago

🙋 Feature Request

The FluentDatePicker should support other types besides of DateTime?. It should fully support these types:

🤔 Expected Behavior

😯 Current Behavior

Currently the FluentDatePicker only supports DateTime?

🔦 Context

I have DateTime properties which cannot be null. Therefore I don't want to create a seperate model or change my implementation to nullable just because the FluentDatePicker only allows for DateTime?

dvoituron commented 1 month ago

We have already discussed about this (in other threads) :-) You have a section "DateOnly, TimeOnly bindings" on https://www.fluentui-blazor.net/DateTime

MarvinKlein1508 commented 1 month ago

Hi @dvoituron,

Thanks for pointing this out. In my opinion, this should be supported out of the box. Can't the component handle the conversion by itself? Otherwise, this will generate a lot of boilerplate code. I'm pretty sure you don't want to write this mapping code yourself each time, right? :)

Perhaps this implementation from another library might be interesting for you guys: https://github.com/vikramlearning/blazorbootstrap/tree/main/blazorbootstrap/Components/Form/DateInput

In my opinion, this kind of stuff is one of the larger weaknesses of this package. Many basic things are pretty hard to implement because there are like three ways of doing something for the same purpose, but only one way works in this scenario and another way works in that scenario.

This library would benefit a lot if those areas could be improved in the future. More stuff would work just like vanilla Blazor.

vnbaaij commented 1 month ago

Thanks for pointing this out. In my opinion, this should be supported out of the box. Can't the component handle the conversion by itself? Otherwise, this will generate a lot of boilerplate code. I'm pretty sure you don't want to write this mapping code yourself each time, right? :)

We'll look at this one for a later release again

Perhaps this implementation from another library might be interesting for you guys: https://github.com/vikramlearning/blazorbootstrap/tree/main/blazorbootstrap/Components/Form/DateInput

Not sure if that one is a good reference as there was a accusation of them stealing copying liberally code from another library

In my opinion, this kind of stuff is one of the larger weaknesses of this package. Many basic things are pretty hard to implement because there are like three ways of doing something for the same purpose, but only one way works in this scenario and another way works in that scenario.

Would be great if we can have a more specific list of things you are running into. It is good for us to hear for devs who are using the library on a 'day-to-day' base. But we have only a limited amount of time available to work on this. As you may know, this is 'just' a side project for both Denis and me. We can't make any promises on when some things might get solved.

This library would benefit a lot if those areas could be improved in the future. More stuff would work just like vanilla Blazor.

Agreed. But as I said time and capacity are and will remain an issue for the foreseeable future.

MarvinKlein1508 commented 1 month ago

Perhaps this implementation from another library might be interesting for you guys: https://github.com/vikramlearning/blazorbootstrap/tree/main/blazorbootstrap/Components/Form/DateInput

Not sure if that one is a good reference as there was a accusation of them ~stealing~ copying liberally code from another library

I think you are referring to the CssBuilder. As far as I know this has been resolved in v3 of the library. But I ain't using it anymore since I've fully switched over to FluentUI.

In my opinion, this kind of stuff is one of the larger weaknesses of this package. Many basic things are pretty hard to implement because there are like three ways of doing something for the same purpose, but only one way works in this scenario and another way works in that scenario.

Would be great if we can have a more specific list of things you are running into. It is good for us to hear for devs who are using the library on a 'day-to-day' base. But we have only a limited amount of time available to work on this. As you may know, this is 'just' a side project for both Denis and me. We can't make any promises on when some things might get solved.

Yes I know. I totally understand that you cannot commit 100% of your time to this project. Whenever I ran into some issues I try to fix them by myself first before I post an issue. I try to put together a list of things But this would blow up this issue here. I might create a topic in the discussions instead. The list is quite long (but many stuff cannot be resolved in this version).

vnbaaij commented 1 month ago

I did not mean here in this issue specifically either. Discussion area is good for this.

The list is quite long (but many stuff cannot be resolved in this version).

Good, because we are also thinking and brainstorming on the next version. Lets discuss further in the standup later today!