Skip to content

Commit b1a4569

Browse files
committed
fix: add InvariantCulture for DateTimeOffset.Parse
1 parent 6d300f0 commit b1a4569

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Microsoft.Toolkit.Uwp.SampleApp/Data/DataGridDataSource.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System;
66
using System.Collections.Generic;
77
using System.Collections.ObjectModel;
8+
using System.Globalization;
89
using System.IO;
910
using System.Linq;
1011
using System.Text;
@@ -30,6 +31,7 @@ public async Task<IEnumerable<DataGridDataItem>> GetDataAsync()
3031
StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(uri);
3132
IRandomAccessStreamWithContentType randomStream = await file.OpenReadAsync();
3233
_items = new ObservableCollection<DataGridDataItem>();
34+
IFormatProvider provider = CultureInfo.InvariantCulture.DateTimeFormat;
3335

3436
using (StreamReader sr = new StreamReader(randomStream.AsStreamForRead()))
3537
{
@@ -48,7 +50,7 @@ public async Task<IEnumerable<DataGridDataItem>> GetDataAsync()
4850
Coordinates = values[4],
4951
Prominence = uint.Parse(values[5]),
5052
Parent_mountain = values[6],
51-
First_ascent = DateTimeOffset.Parse(values[7]),
53+
First_ascent = DateTimeOffset.Parse(values[7], provider),
5254
Ascents = values[8],
5355
});
5456
}

0 commit comments

Comments
 (0)