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

Adds support for Seconds to TimePicker #16079

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

begleysm
Copy link

@begleysm begleysm commented Jun 20, 2024

What does the pull request do?

This PR adds support for Seconds to the TimePicker Control (which currently only supports Hours and Minutes). It adds a UseSeconds Property which defaults to false. It addresses a need being tracked in Issue #12045.

What is the updated/expected behavior with this PR?

Usage of existing TimePicker Controls should see no change since the new UseSeconds Property is optional and defaults to false which results in the TimePicker behaving just as it did before.

How was the solution implemented (if it's not obvious)?

I first went through and added the Seconds column by finding all of the references to Minutes and duplicating their behavior. I expanded the PickerHosts, TextBlocks, Dividers, etc and updated the ClockIdentifier column to be to the right of the new Seconds column. I then went through and found all of the references to ClockIdentifier and use it as a template on how to show/hide the new Seconds column based on my new UseSeconds property. Everywhere possible I tried to use naming consistent with the existing parameters. I also updated the DateTimePickerPage of the ControlCatalog to demonstrate the new UseSeconds feature. I added a updated one of the Unit Tests and added a Unit Test.

Checklist

  • [ X ] Added unit tests (if possible)?
  • [ X ] Added XML documentation to any related classes?
  • [ will do when PR is accepted ] Consider submitting a PR to https://github.com/AvaloniaUI/avalonia-docs with user documentation

Breaking changes

None

Obsoletions / Deprecations

None

Fixed issues

Fixes #12045

Example Screenshot

image

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.2.999-cibuild0049181-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@cla-avalonia
Copy link
Collaborator

cla-avalonia commented Jun 20, 2024

  • All contributors have signed the CLA.

@begleysm
Copy link
Author

@cla-avalonia agree

1 similar comment
@begleysm
Copy link
Author

@cla-avalonia agree

Copy link
Member

@jmacato jmacato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good to me! Thank you for your contribution!

cc @maxkatz6 @grokys

@maxkatz6 maxkatz6 added enhancement api API addition labels Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api API addition enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TimePicker No Select Second
5 participants