Conversation
|
Thanks for opening this, but we'd appreciate a little more information. Could you update it with more details? |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR refactors timezone handling to use NodaTime and IANA timezone identifiers (resolved via TZConvert). Core conversion and offset logic moved to NodaTime; dependent services (email template and workflow context builder) were updated to use the new helpers and tzdb-based conversions. ChangesTimezone Conversion Refactoring
🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
Core/Resgrid.Model/Helpers/TimeConverterHelper.cs (1)
69-69:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winInconsistent
ConvertTimeZoneStringusage across methods.
TimeConverter(line 31) andGetOffsetForDepartment(line 113) both callDateTimeHelpers.ConvertTimeZoneString(timeZone)before passing toTZConvert.WindowsToIana, butTimeConverterToStringhere passestimeZonedirectly. IfConvertTimeZoneStringnormalizes non-standard timezone IDs, this inconsistency could cause different conversion behavior between methods.🔧 Proposed fix for consistency
- var ianaTz = TZConvert.WindowsToIana(timeZone); + var ianaTz = TZConvert.WindowsToIana(DateTimeHelpers.ConvertTimeZoneString(timeZone));🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@Core/Resgrid.Model/Helpers/TimeConverterHelper.cs` at line 69, The TimeConverterToString method is inconsistent: unlike TimeConverter and GetOffsetForDepartment it calls TZConvert.WindowsToIana(timeZone) directly; change TimeConverterToString to first normalize the input by calling DateTimeHelpers.ConvertTimeZoneString(timeZone) and pass that result into TZConvert.WindowsToIana so all three methods use the same normalized timezone string (reference methods: TimeConverter, GetOffsetForDepartment, TimeConverterToString).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Core/Resgrid.Services/CallEmailTemplates/ParklandCounty2Template.cs`:
- Around line 56-61: Add a null/empty check and fallback before converting the
department timezone: if department.TimeZone is null or whitespace, use the same
default used by TimeConverterHelper (e.g., "Pacific Standard Time") before
calling TZConvert.WindowsToIana; update the block around
TZConvert.WindowsToIana(department.TimeZone) / LocalDateTime.FromDateTime(...) /
.InZoneLeniently(DateTimeZoneProviders.Tzdb[...]) so you pass a non-null, valid
Windows zone id to TZConvert.WindowsToIana and avoid InvalidTimeZoneException
and unintended UTC fallback for callTimeUtc.
---
Outside diff comments:
In `@Core/Resgrid.Model/Helpers/TimeConverterHelper.cs`:
- Line 69: The TimeConverterToString method is inconsistent: unlike
TimeConverter and GetOffsetForDepartment it calls
TZConvert.WindowsToIana(timeZone) directly; change TimeConverterToString to
first normalize the input by calling
DateTimeHelpers.ConvertTimeZoneString(timeZone) and pass that result into
TZConvert.WindowsToIana so all three methods use the same normalized timezone
string (reference methods: TimeConverter, GetOffsetForDepartment,
TimeConverterToString).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 449279e1-dc60-445d-95d1-a9edd20bab77
📒 Files selected for processing (3)
Core/Resgrid.Model/Helpers/TimeConverterHelper.csCore/Resgrid.Services/CallEmailTemplates/ParklandCounty2Template.csCore/Resgrid.Services/WorkflowTemplateContextBuilder.cs
|
Approve |
Summary by CodeRabbit