fix(payment-items): use ImporterBase.ParseWireDateTime
This commit is contained in:
@@ -42,11 +42,11 @@ public class PaymentItemImporter
|
||||
entry.PurchaseLimit = s.PurchaseLimit;
|
||||
entry.SpecialShopFlag = s.SpecialShopFlag;
|
||||
entry.ImageName = s.ImageName;
|
||||
entry.StartTime = ParseDate(s.StartTime);
|
||||
entry.EndTime = ParseDate(s.EndTime);
|
||||
entry.StartTime = ImporterBase.ParseWireDateTime(s.StartTime);
|
||||
entry.EndTime = ImporterBase.ParseWireDateTime(s.EndTime);
|
||||
entry.RemainingTime = s.RemainingTime;
|
||||
entry.IsResaleProduct = s.IsResaleProduct;
|
||||
entry.ResaleStartDate = string.IsNullOrWhiteSpace(s.ResaleStartDate) ? null : ParseDate(s.ResaleStartDate);
|
||||
entry.ResaleStartDate = string.IsNullOrWhiteSpace(s.ResaleStartDate) ? null : ImporterBase.ParseWireDateTime(s.ResaleStartDate);
|
||||
|
||||
if (ex is null)
|
||||
{
|
||||
@@ -61,9 +61,4 @@ public class PaymentItemImporter
|
||||
Console.WriteLine($"[PaymentItemImporter] +{created}/~{updated}");
|
||||
return created + updated;
|
||||
}
|
||||
|
||||
private static DateTime ParseDate(string s) =>
|
||||
DateTime.TryParse(s, CultureInfo.InvariantCulture,
|
||||
DateTimeStyles.AssumeUniversal | DateTimeStyles.AdjustToUniversal,
|
||||
out var dt) ? dt : DateTime.MinValue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user