Skip to content

Commit

Permalink
Print character birth with an en US culture
Browse files Browse the repository at this point in the history
  • Loading branch information
amoeba committed Aug 4, 2016
1 parent 30d6363 commit f98e7bb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Character.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Text;
using System.Net;
using WindowsTimer = System.Windows.Forms.Timer;

using System.Globalization;
using Decal.Adapter;
using Decal.Adapter.Wrappers;

Expand Down Expand Up @@ -240,6 +240,11 @@ internal static void GetCharacterInfo()
character = cf.Name;
server = cf.Server;

// Prepare the en-US culture for string creation
// I use this because I want my dates to all be formatted as if
// the client using an en-US locale
CultureInfo culture_en_us = new CultureInfo("en-US");

// One long string stores the entire POST request body
// And the string is generated with StringBuilder
StringBuilder req = new StringBuilder();
Expand Down Expand Up @@ -287,7 +292,7 @@ internal static void GetCharacterInfo()


req.AppendFormat("\"deaths\":{0},", cf.Deaths);
req.AppendFormat("\"birth\":\"{0}\",", cf.Birth);
req.AppendFormat("\"birth\":\"{0}\",", cf.Birth.ToString(culture_en_us));
req.AppendFormat("\"total_xp\":{0},", cf.TotalXP);
req.AppendFormat("\"unassigned_xp\":{0},", cf.UnassignedXP);
req.AppendFormat("\"skill_credits\":{0},", cf.SkillPoints);
Expand Down

0 comments on commit f98e7bb

Please sign in to comment.