Skip to content

Commit

Permalink
Finally fix day parse
Browse files Browse the repository at this point in the history
  • Loading branch information
wh0o7 committed Nov 13, 2023
1 parent 486f992 commit cc711da
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions StudentsTimetable/Services/ParseService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ private async Task ParseDay()
if (lessonsElements.Count < 1 || lessonsElements[0].TagName == "p")
{
groupInfo.Lessons = lessons;
groupInfo.Number = int.Parse(group);
groupInfo.Number = int.Parse(group.Replace("*", ""));
groupInfos.Add(groupInfo);
continue;
}
Expand Down Expand Up @@ -281,7 +281,8 @@ private async Task ParseWeek()
var weekIntervalStr = h3[0].Text;
var weekInterval = Utils.ParseDateTimeWeekInterval(weekIntervalStr);
var isIsNewInterval = IsNewInterval;
if (_weekInterval is null || !string.IsNullOrEmpty(weekIntervalStr) && _weekInterval != weekInterval)
if (_weekInterval is null || !string.IsNullOrEmpty(weekIntervalStr) && _weekInterval.Length == 2 &&
weekInterval is not null && weekInterval.Length == 2 && _weekInterval[1] != weekInterval[1])
{
IsNewInterval = _weekInterval is not null;
if (_weekInterval is null || _weekInterval[1] is not null && DateTime.Today == _weekInterval[1])
Expand Down

0 comments on commit cc711da

Please sign in to comment.