Skip to content
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

TimePicker No Select Second #12045

Open
netsmallhao opened this issue Jul 5, 2023 · 14 comments · May be fixed by #16079
Open

TimePicker No Select Second #12045

netsmallhao opened this issue Jul 5, 2023 · 14 comments · May be fixed by #16079

Comments

@netsmallhao
Copy link

why?

@rabbitism
Copy link
Contributor

I believe this control is migrated from winui, the original design is like this. Need some improvement.

@yll690
Copy link
Contributor

yll690 commented Jul 6, 2023

I need this, too.

@netsmallhao
Copy link
Author

This design is actually unreasonable. It may not take seconds on apps, but selecting seconds on PCs is necessary and switch control can be added

@timunie
Copy link
Contributor

timunie commented Jul 6, 2023

I think this should be controllable by a property. I don't know which one would be best. I think either

bool ShowSeconds {get; set;}
enum DisplayMode [hh:mm , hh:mm:ss, ...]

@PITON369
Copy link

PITON369 commented Jul 28, 2023

Need seconds. Or another type TimePicker with seconds.

@lhsrebel72
Copy link
Contributor

@maxkatz6 @robloo would either of you be able to confirm this is a wanted feature? I'd love to pick this up next but, just wanted to make sure it is desired and see if there are any guidelines I should follow while implementing it.

@maxkatz6
Copy link
Member

maxkatz6 commented Aug 8, 2023

microsoft/microsoft-ui-xaml#1440

TimePicker was designed to be a time picker, not a duration picker. But it's a reasonable request to have such a control. I just don't know if we should extend TimePicker versus adding a new thing.

So, yes - it is "by design". Can be changed though.

@timunie
Copy link
Contributor

timunie commented Aug 8, 2023

Okay, so for now we need to wait for upstream to decide or for the team to have enough time to decide which API is probably the best for Avalonia. Right now I suggest to write a custom control for your usage. If you want, you can share the control in this issue and if later someone thinks it's the right approach, it still can be merged in.

@robloo
Copy link
Contributor

robloo commented Aug 8, 2023

Okay, so for now we need to wait for upstream to decide or for the team to have enough time to decide which API is probably the best for Avalonia.

Well, I don't think we should EVER wait for upstream. WinUI is dying down quite a bit in areas like this. I would be very surprised if there is ever any movement in this space. I do expect they are cooking up several things behind the scenes for Windows 12 though. That said:

Right now I suggest to write a custom control for your usage.

I kind-of agree with this. Second selection is valid in some cases but not for most. I don't think we should complicate the control unless a really good design is found. Perhaps the design is simply to add an optional seconds column which might be fairly straightforward though.

These controls (DatePicker and TimePicker) are also a bit tricky simply due to the way the flyout presenters work. It may not be a great beginning project -- who knows though and I don't want to discourage anything.

Since controls are so widely used I highly suggest providing a visual design for the changes you are proposing and then even a mock-up before any coding here starts.

@mate1213
Copy link

Hi!
Is any progress on this?
I'm willing to help, if needed.
It would be great feature.

@timunie
Copy link
Contributor

timunie commented Jan 11, 2024

@mate1213 I think my comment is still valid: #12045 (comment)

So I see 2 options you can help:

  1. create your own control extending the original control with these properties added. Would be great if you share the code here.
  2. Clone Avalonia and work on the implementation proposal and file a PR for us to review when we find the time to do so. (knowing it may be rejected in the worst case). The PR will crteate a nuget package for anyone to test.

If you go with 2), make sure to read build instructions.

@mate1213
Copy link

Great!
Will try to do it the proper 2nd way. :D
I will check in when I started.

@begleysm
Copy link

begleysm commented May 9, 2024

Just dropping in to say I need a TimePicker that supports seconds too and was quite surprised to see that this isn't a supported feature of TimePicker.

@begleysm begleysm linked a pull request Jun 20, 2024 that will close this issue
@begleysm
Copy link

I've submitted PR #16079 that adds a new UseSeconds Property (that defaults to false keeping existing usages of TimePicker unaffected) that displays a Seconds column in the TimePicker Control when set to true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants