Skip to content

Commit

Permalink
Move TryParseTDMDate() from Common to TDMCommon
Browse files Browse the repository at this point in the history
  • Loading branch information
FenPhoenix committed Apr 4, 2024
1 parent 7ac1e90 commit cecf1b7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
13 changes: 1 addition & 12 deletions AL_Common/General/Common.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Globalization;
using System.Globalization;
using System.Net;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
Expand Down Expand Up @@ -125,16 +124,6 @@ public NameAndIndex(string name)

public static string ToStrInv(this bool value) => value.ToString(NumberFormatInfo.InvariantInfo);

public static bool TryParseTDMDate(string dateString, out DateTime dateTime)
{
return DateTime.TryParseExact(
dateString,
"yyyy-M-d",
DateTimeFormatInfo.InvariantInfo,
DateTimeStyles.None,
out dateTime);
}

public static string GetPlainInnerText(this XmlNode? node) =>
node == null ? "" : WebUtility.HtmlDecode(node.InnerText);

Expand Down
11 changes: 11 additions & 0 deletions AL_Common/TDMCommon.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using static AL_Common.Common;

Expand Down Expand Up @@ -107,6 +108,16 @@ public static string ConvertToValidTDMInternalName(this string value, string ext

return sb.ToString();
}

public static bool TryParseTDMDate(string dateString, out DateTime dateTime)
{
return DateTime.TryParseExact(
dateString,
"yyyy-M-d",
DateTimeFormatInfo.InvariantInfo,
DateTimeStyles.None,
out dateTime);
}
}

public sealed class TDM_ServerFMData
Expand Down

0 comments on commit cecf1b7

Please sign in to comment.