Skip to content

Commit

Permalink
Fix parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
DreamerDeLy committed Feb 19, 2023
1 parent 40c4fee commit 2a5488c
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions GitHubContributionsParserV/FormMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,13 +230,22 @@ private Data Parse(string user)

try
{
string data_count = nodeDay.Attributes["data-count"].Value;
string data_date = nodeDay.Attributes["data-date"].Value;

day.counter = Int32.Parse(data_count);
day.date = DateTime.Parse(data_date);

current.calendar.Add(day);
if (nodeDay.Attributes.Contains("data-date"))
{
//string data_count = nodeDay.Attributes["data-count"].Value;
string data_date = nodeDay.Attributes["data-date"].Value;
string data_count = "0";

if (!nodeDay.InnerText.StartsWith("No"))
{
data_count = nodeDay.InnerText.Split(' ')[0];
}

day.counter = Int32.Parse(data_count);
day.date = DateTime.Parse(data_date);

current.calendar.Add(day);
}
}
catch (Exception ex)
{
Expand Down

0 comments on commit 2a5488c

Please sign in to comment.