radzenhq / radzen-blazor

Radzen Blazor is a set of 90+ free native Blazor UI components packed with DataGrid, Scheduler, Charts and robust theming including Material design and FluentUI.
https://www.radzen.com
MIT License
3.52k stars 785 forks source link

Error in demo Dashboard #30

Closed dingetje closed 3 years ago

dingetje commented 3 years ago

Describe the bug Opening the demo Dashboard resulted in the following error:

An error has occurred: Year, Month, and Day parameters describe an un-representable DateTime.. Try reloading your browser.

To Reproduce Steps to reproduce the behavior:

  1. Download the demo project, build and debug
  2. Click on 'Dashboard' in the resulting web page in January!
  3. See error

Expected behavior Dashboard should collect github issues data from last month.

Screenshots image

Desktop (please complete the following information):

Additional context Issue is caused by this line of code in the GitHubService.cs:

var lastMonth = new DateTime(date.Year, date.Month - 1, 1);

After changing it into:

var lastMonth = new DateTime(date.Year, date.Month, 1);
lastMonth = lastMonth.AddMonths(-1);

it worked as expected.

akorchev commented 3 years ago

We have changed that some time ago. Are you using the latest version? https://github.com/radzenhq/radzen-blazor/blob/master/RadzenBlazorDemos/Services/GitHubService.cs#L99

dingetje commented 3 years ago

My bad, I downloaded this from a forked repository. Ticket can be closed (although I liked my fix better 😁 )