diff --git a/Wonky.Client/Components/WorkDateComponent.razor.cs b/Wonky.Client/Components/WorkDateComponent.razor.cs
index ad1dbedc..29dc12f9 100644
--- a/Wonky.Client/Components/WorkDateComponent.razor.cs
+++ b/Wonky.Client/Components/WorkDateComponent.razor.cs
@@ -27,20 +27,30 @@ public partial class WorkDateComponent : IDisposable
///
/// User preference service
///
- [Inject] public UserPrefService Prefs { get; set; }
+ [Inject]
+ public UserPrefService Prefs { get; set; }
+
///
/// OnChanged callback function
///
- [Parameter] public EventCallback OnChangedCallback { get; set; }
+ [Parameter]
+ public EventCallback OnChangedCallback { get; set; }
+
+ ///
+ /// work date context holding the edit value
+ ///
private EditContext WorkDateContext { get; set; }
+
///
/// Selected data
///
private DateTime SelectedDate { get; set; }
+
///
/// user preferences
///
private UserPref _prefs = new();
+
///
/// Component Initialization
///
@@ -49,10 +59,11 @@ public partial class WorkDateComponent : IDisposable
WorkDateContext = new EditContext(SelectedDate);
Prefs.OnChange += ProfileServiceOnOnChange;
_prefs = await Prefs.GetPreferences();
- SelectedDate = string.IsNullOrWhiteSpace(_prefs.WorkDate)
+ SelectedDate = string.IsNullOrWhiteSpace(_prefs.WorkDate)
? DateTime.Now
: DateTime.Parse(_prefs.WorkDate);
}
+
///
/// OnDateChanged function call to invoke the event callback
///
@@ -63,6 +74,7 @@ public partial class WorkDateComponent : IDisposable
await Prefs.SetWorkDate(val);
await OnChangedCallback.InvokeAsync($"{val:yyyy-MM-dd}");
}
+
///
/// ProfileService
///
@@ -72,6 +84,7 @@ public partial class WorkDateComponent : IDisposable
_prefs = newUserPref;
StateHasChanged();
}
+
///
/// Component dispose
///