Skip to content

Commit 2a5488c

Browse files
committed
Fix parsing
1 parent 40c4fee commit 2a5488c

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

GitHubContributionsParserV/FormMain.cs

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -230,13 +230,22 @@ private Data Parse(string user)
230230

231231
try
232232
{
233-
string data_count = nodeDay.Attributes["data-count"].Value;
234-
string data_date = nodeDay.Attributes["data-date"].Value;
235-
236-
day.counter = Int32.Parse(data_count);
237-
day.date = DateTime.Parse(data_date);
238-
239-
current.calendar.Add(day);
233+
if (nodeDay.Attributes.Contains("data-date"))
234+
{
235+
//string data_count = nodeDay.Attributes["data-count"].Value;
236+
string data_date = nodeDay.Attributes["data-date"].Value;
237+
string data_count = "0";
238+
239+
if (!nodeDay.InnerText.StartsWith("No"))
240+
{
241+
data_count = nodeDay.InnerText.Split(' ')[0];
242+
}
243+
244+
day.counter = Int32.Parse(data_count);
245+
day.date = DateTime.Parse(data_date);
246+
247+
current.calendar.Add(day);
248+
}
240249
}
241250
catch (Exception ex)
242251
{

0 commit comments

Comments
 (0)