Skip to content
Merged
Prev Previous commit
Remove xmldoc for non-existing parameter "kind"
Also refactor for SonarCloud complaints
  • Loading branch information
axunonb committed Nov 22, 2024
commit 7bf9c3b8871345cdc8e8c3a4cd97e773ddd93e56
2 changes: 0 additions & 2 deletions Ical.Net/CalendarComponents/UniqueComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ private void EnsureProperties()
// See https://sourceforge.net/projects/dday-ical/forums/forum/656447/topic/3754354
if (DtStamp == null)
{
// icalendar RFC doesn't care about sub-second time resolution, so shave off everything smaller than seconds.
var utcNow = DateTime.UtcNow.Truncate(TimeSpan.FromSeconds(1));
DtStamp = CalDateTime.UtcNow;
}
}
Expand Down
4 changes: 2 additions & 2 deletions Ical.Net/DataTypes/CalDateTime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ public CalDateTime(int year, int month, int day, string? tzId = null)
/// <summary>
/// Creates a new instance of the <see cref="CalDateTime"/> class using the specified timezone.
/// </summary>
/// <param name="kind">If <see langword="null"/>, <see cref="DateTimeKind.Unspecified"/> is used.</param>
/// <param name="tzId">The specified value will determine the <see cref="DateTime.Kind"/> property.
/// If the timezone specified is UTC, the underlying <see cref="DateTime.Kind"/> will be
/// <see cref="DateTimeKind.Utc"/>. If a non-UTC timezone or no timezone is specified, the underlying
Expand Down Expand Up @@ -400,6 +399,7 @@ public string? TzId
return;
}

_tzId = value;
Initialize(_dateOnly, HasTime ? _timeOnly : null, value);
}
}
Expand Down Expand Up @@ -694,7 +694,7 @@ public string ToString(string? format, IFormatProvider? formatProvider)
return $"{dateTimeOffset.TimeOfDay.ToString(format, formatProvider)} {_tzId}";
}

if (HasTime && HasDate)
if (HasTime)
{
return $"{dateTimeOffset.ToString(format, formatProvider)} {_tzId}";
}
Expand Down
4 changes: 2 additions & 2 deletions Ical.Net/Evaluation/RecurrencePatternEvaluator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace Ical.Net.Evaluation;

public class RecurrencePatternEvaluator : Evaluator
{
private const int _maxIncrementCount = 1000;
private const int MaxIncrementCount = 1000;

protected RecurrencePattern Pattern { get; set; }

Expand Down Expand Up @@ -284,7 +284,7 @@ private HashSet<DateTime> GetDates(IDateTime seed, DateTime periodStart, DateTim
else
{
noCandidateIncrementCount++;
if (_maxIncrementCount > 0 && noCandidateIncrementCount > _maxIncrementCount)
if (noCandidateIncrementCount > MaxIncrementCount)
{
break;
}
Expand Down