fix: add InvariantCulture for DateTimeOffset.Parse
This commit is contained in:
Родитель
6d300f0fc2
Коммит
b1a4569ebe
|
@ -5,6 +5,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
@ -30,6 +31,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.Data
|
|||
StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(uri);
|
||||
IRandomAccessStreamWithContentType randomStream = await file.OpenReadAsync();
|
||||
_items = new ObservableCollection<DataGridDataItem>();
|
||||
IFormatProvider provider = CultureInfo.InvariantCulture.DateTimeFormat;
|
||||
|
||||
using (StreamReader sr = new StreamReader(randomStream.AsStreamForRead()))
|
||||
{
|
||||
|
@ -48,7 +50,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.Data
|
|||
Coordinates = values[4],
|
||||
Prominence = uint.Parse(values[5]),
|
||||
Parent_mountain = values[6],
|
||||
First_ascent = DateTimeOffset.Parse(values[7]),
|
||||
First_ascent = DateTimeOffset.Parse(values[7], provider),
|
||||
Ascents = values[8],
|
||||
});
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче