feat: fix several selection issue related to 12 clock mode.

This commit is contained in:
rabbitism
2024-04-26 20:34:20 +08:00
parent 1e5da1869c
commit 63b9ccfe5e
4 changed files with 52 additions and 50 deletions

View File

@@ -266,7 +266,9 @@ public class TimePickerPresenter: TemplatedControl
var time = Time ?? DateTime.Now.TimeOfDay;
if (_hourSelector is not null)
{
_hourSelector.SelectedValue = _use12Clock ? time.Hours % 12 : time.Hours;
var index = _use12Clock ? time.Hours % 12 : time.Hours;
if (index == 0) index = 12;
_hourSelector.SelectedValue = index;
}
if (_minuteSelector is not null)
{