문제

Dim months As New List(Of Date)
months = months.Distinct().ToList()

This filters very unique dates because of time difference. I want to filter dates discarding times but only considering unique elements with month and year.

도움이 되었습니까?

해결책

You need to take just the year and month from each date, and find the distinct values from that.

months = months.Select(Function(x) New Date(x.Year, x.Month, 1)).Distinct().ToList()
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top