Compare commits
1 Commits
v1.7.0
...
ffe0fb9820
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ffe0fb9820 |
@@ -1,3 +1,4 @@
|
||||
using System.Globalization;
|
||||
using ClaudeDo.Ui.Services;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
@@ -23,8 +24,26 @@ public sealed partial class PrimeScheduleRowViewModel : ViewModelBase
|
||||
|
||||
public string LastRunLabel => LastRunAt is { } v ? v.LocalDateTime.ToString("g") : "—";
|
||||
|
||||
private static readonly string[] TimeFormats = { @"h\:mm", @"hh\:mm" };
|
||||
|
||||
public string TimeText
|
||||
{
|
||||
get => TimeOfDay.ToString(@"hh\:mm", CultureInfo.InvariantCulture);
|
||||
set
|
||||
{
|
||||
if (TimeSpan.TryParseExact(value, TimeFormats, CultureInfo.InvariantCulture, out var t)
|
||||
&& t >= TimeSpan.Zero && t < TimeSpan.FromDays(1))
|
||||
{
|
||||
TimeOfDay = t;
|
||||
}
|
||||
OnPropertyChanged(nameof(TimeText));
|
||||
}
|
||||
}
|
||||
|
||||
partial void OnLastRunAtChanged(DateTimeOffset? value) => OnPropertyChanged(nameof(LastRunLabel));
|
||||
|
||||
partial void OnTimeOfDayChanged(TimeSpan value) => OnPropertyChanged(nameof(TimeText));
|
||||
|
||||
public PrimeScheduleRowViewModel(PrimeScheduleDto dto, bool isExisting)
|
||||
{
|
||||
Id = dto.Id;
|
||||
|
||||
@@ -224,10 +224,10 @@
|
||||
<ToggleButton Classes="day-toggle" Content="{loc:Tr settings.prime.daySa}" IsChecked="{Binding Saturday, Mode=TwoWay}"/>
|
||||
<ToggleButton Classes="day-toggle" Content="{loc:Tr settings.prime.daySu}" IsChecked="{Binding Sunday, Mode=TwoWay}"/>
|
||||
</StackPanel>
|
||||
<TimePicker Grid.Column="2"
|
||||
SelectedTime="{Binding TimeOfDay, Mode=TwoWay}"
|
||||
ClockIdentifier="24HourClock" MinuteIncrement="5"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBox Grid.Column="2"
|
||||
Text="{Binding TimeText, Mode=TwoWay}"
|
||||
PlaceholderText="HH:mm" MaxLength="5"
|
||||
Width="68" VerticalAlignment="Center"/>
|
||||
<TextBlock Classes="meta" Grid.Column="3" Text="{Binding LastRunLabel}" VerticalAlignment="Center"
|
||||
MinWidth="80"/>
|
||||
<Button Classes="icon-btn" Grid.Column="4" Content="✕"
|
||||
|
||||
Reference in New Issue
Block a user