-
Notifications
You must be signed in to change notification settings - Fork 743
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18991 from unoplatform/dev/ks/native-timepicker
chore: native timepicker- set -initial time
- Loading branch information
Showing
5 changed files
with
108 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 10 additions & 1 deletion
11
src/Uno.UI/UI/Xaml/Controls/TimePicker/NativeTimePickerFlyout.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,16 @@ | ||
using Microsoft.UI.Xaml.Controls.Primitives; | ||
using System; | ||
using Windows.Globalization; | ||
using Microsoft.UI.Xaml.Controls.Primitives; | ||
|
||
namespace Microsoft.UI.Xaml.Controls; | ||
|
||
internal partial class NativeTimePickerFlyout : TimePickerFlyout | ||
{ | ||
protected TimeSpan GetCurrentTime() | ||
{ | ||
var calendar = new Calendar(); | ||
calendar.SetToNow(); | ||
var currentDateTime = calendar.GetDateTime(); | ||
return new TimeSpan(currentDateTime.Hour, currentDateTime.Minute, currentDateTime.Second); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters