take timezone into account
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/Tiles/WalletBalanceChartTileViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/Tiles/WalletBalanceChartTileViewModel.cs
@@ -135,34 +135,24 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.Tiles
var range = DateTimeOffset.FromUnixTimeMilliseconds((long)maxX) -
DateTimeOffset.FromUnixTimeMilliseconds((long)minX);
+ var stringFormatOption = "MMM-d";
+
if (range <= TimeSpan.FromDays(1))
{
- XLabels = new List<string>
- {
- DateTimeOffset.FromUnixTimeMilliseconds((long) minX).DateTime.ToString("t"),
- DateTimeOffset.FromUnixTimeMilliseconds((long) halfX).DateTime.ToString("t"),
- DateTimeOffset.FromUnixTimeMilliseconds((long) maxX).DateTime.ToString("t"),
- };
+ stringFormatOption = "t";
}
else if (range <= TimeSpan.FromDays(7))
{
- XLabels = new List<string>
- {
- DateTimeOffset.FromUnixTimeMilliseconds((long) minX).DateTime.ToString("ddd MMM-d"),
- DateTimeOffset.FromUnixTimeMilliseconds((long) halfX).DateTime.ToString("ddd MMM-d"),
- DateTimeOffset.FromUnixTimeMilliseconds((long) maxX).DateTime.ToString("ddd MMM-d"),
- };
+ stringFormatOption = "ddd MMM-d";
}
- else
- {
+
XLabels = new List<string>
{
- DateTimeOffset.FromUnixTimeMilliseconds((long) minX).DateTime.ToString("MMM-d"),
- DateTimeOffset.FromUnixTimeMilliseconds((long) halfX).DateTime.ToString("MMM-d"),
- DateTimeOffset.FromUnixTimeMilliseconds((long) maxX).DateTime.ToString("MMM-d"),
+ DateTimeOffset.FromUnixTimeMilliseconds((long)minX).ToLocalTime().ToString(stringFormatOption),
+ DateTimeOffset.FromUnixTimeMilliseconds((long)halfX).ToLocalTime().ToString(stringFormatOption),
+ DateTimeOffset.FromUnixTimeMilliseconds((long)maxX).ToLocalTime().ToString(stringFormatOption),
};
}
- }
else
{
XLabels = null;

take timezone into account