diff --git a/EliteBGS/MainWindow.xaml b/EliteBGS/MainWindow.xaml
index b6839a4..308b6e3 100644
--- a/EliteBGS/MainWindow.xaml
+++ b/EliteBGS/MainWindow.xaml
@@ -42,9 +42,11 @@
-
+
+
+
diff --git a/EliteBGS/MainWindow.xaml.cs b/EliteBGS/MainWindow.xaml.cs
index 163c6c9..e60c1bf 100644
--- a/EliteBGS/MainWindow.xaml.cs
+++ b/EliteBGS/MainWindow.xaml.cs
@@ -57,16 +57,17 @@ public partial class MainWindow : Window {
journal = new PlayerJournal(Config.Global.JournalLocation);
// Set both to now
- startdate.CultureInfo = enddate.CultureInfo = CultureInfo.InvariantCulture;
- ResetTime();
+ InitialiseTime();
journallocation.Text = Config.Global.JournalLocation;
}
- private void ResetTime() {
+ private void InitialiseTime() {
DateTime today = DateTime.Today;
DateTime tomorrow = today.AddDays(1);
+ startdate.CultureInfo = enddate.CultureInfo = CultureInfo.InvariantCulture;
+
startdate.Value = today;
enddate.Value = tomorrow;
}
@@ -372,4 +373,26 @@ public partial class MainWindow : Window {
RefreshView();
}
}
+
+ private DateTime ResetTimeToZero(DateTime d) {
+ DateTime obj = d;
+
+ obj = obj.AddHours(d.Hour * -1);
+ obj = obj.AddMinutes(d.Minute * -1);
+ obj = obj.AddSeconds(d.Second * -1);
+
+ return obj;
+ }
+
+ private void ResetTime_Click(object sender, RoutedEventArgs e) {
+ DateTime? d = startdate.Value;
+ if (d != null) {
+ startdate.Value = ResetTimeToZero(d.Value);
+ }
+
+ d = enddate.Value;
+ if (d != null) {
+ enddate.Value = ResetTimeToZero(d.Value);
+ }
+ }
}