Activities > Due Date > Only render if available #4218
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix
```ActionView::Template::Error (undefined method
to_date' for nil): 2025-09-07T05:33:50.187788+00:00 app[web.1]: [7ae81f90-c47f-c5ae-550a-bef505f3a202] 2025-09-07T05:33:50.187790+00:00 app[web.1]: Causes: 2025-09-07T05:33:50.187793+00:00 app[web.1]: [7ae81f90-c47f-c5ae-550a-bef505f3a202] NoMethodError (undefined methodto_date' for nil)2025-09-07T05:33:50.187793+00:00 app[web.1]: [7ae81f90-c47f-c5ae-550a-bef505f3a202] 24: = link_to activity_path(slug: activity.slug) do
2025-09-07T05:33:50.187794+00:00 app[web.1]: [7ae81f90-c47f-c5ae-550a-bef505f3a202] 25: %h4= activity.name
2025-09-07T05:33:50.187794+00:00 app[web.1]: [7ae81f90-c47f-c5ae-550a-bef505f3a202] 26: %small.due-date{title: activity.due_date}
2025-09-07T05:33:50.187795+00:00 app[web.1]: [7ae81f90-c47f-c5ae-550a-bef505f3a202] 27: = standard_time_distance(activity.due_date.to_date, Time.zone.now.to_date)
2025-09-07T05:33:50.187796+00:00 app[web.1]: [7ae81f90-c47f-c5ae-550a-bef505f3a202] 28: %div
2025-09-07T05:33:50.187796+00:00 app[web.1]: [7ae81f90-c47f-c5ae-550a-bef505f3a202] 29: %small.text-justify{title: activity.description}= activity.description.truncate(150)
2025-09-07T05:33:50.187805+00:00 app[web.1]: [7ae81f90-c47f-c5ae-550a-bef505f3a202] 30: %p