Skip to content

Commit 8be9fbe

Browse files
Make md5hash independent of the current culture thread. (#800)
* Make md5hash independent of the current culture thread. * Keep compatibility with format used for datetime string on md5hash. * Fix test for the last change in md5hash with datetimes.
1 parent 5efbb51 commit 8be9fbe

File tree

3 files changed

+2312
-6
lines changed

3 files changed

+2312
-6
lines changed

dotnet/src/dotnetframework/GxClasses/Model/GXSilentTrn.cs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,7 @@ public IGxContext context
609609

610610
public bool isWrappedInCollection = true;
611611

612+
const string DateFormat = "M/d/yyyy h:mm:ss tt";
612613
public override string ToString()
613614
{
614615
string s = "";
@@ -629,14 +630,17 @@ public override string ToString()
629630
if (o != null)
630631
{
631632
#if NETCORE
632-
var fixedPoint = "F";
633-
if (o is decimal)
634-
s += ((decimal)o).ToString(fixedPoint, CultureInfo.InvariantCulture);
635-
else
636-
s += o.ToString();
633+
string fixedPoint = "F";
634+
if (o is decimal)
635+
s += ((decimal)o).ToString(fixedPoint, CultureInfo.InvariantCulture);
637636
#else
638-
s += o.ToString();
637+
if (o is decimal)
638+
s += ((decimal)o).ToString(CultureInfo.InvariantCulture);
639639
#endif
640+
else if (o is DateTime)
641+
s += ((DateTime)o).ToString(DateFormat, CultureInfo.InvariantCulture);
642+
else
643+
s += o.ToString();
640644
}
641645
}
642646
}

0 commit comments

Comments
 (0)