fix(payment-items): use ImporterBase.ParseWireDateTime

This commit is contained in:
gamer147
2026-05-26 14:08:40 -04:00
parent c23c56d46c
commit f66d20e039

View File

@@ -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;
}