- πΊπΈUnited States SiliconValet
Old issue but same source. Patch can be found here:
https://www.drupal.org/project/calendar_link/issues/3392784#comment-1530... π calendar_link() fails silently if date is string but can't be parsed Active
Using Drupal 9.3.22, Calendar Link 2.1.4. It works greate for Date and Time field. But I am using the Datetime Range field. In the twig template node--page.html.twig, I added this:
{% set link = calendar_link('google', node.title, node.field_date_range.value, node.field_date_range.end_value, node.body) %}
<a href="{{ link }}">Add to calendar</a>
I get the error: Could not get date and time from input value 2023-01-16T07:14:26 ()
The correct start date is shown in the error.
I found in this post β , they are using split to separate the start and end date. I could not get split to work.
This works, but the time is 12am for both start and end time
{% set link = calendar_link('google', node.title, node.field_date_range.start_date, node.field_date_range.end_date, node.body) %}
<a href="{{ link }}">Add to calendar</a>
I tried to add the time, but get error - Could not get date and time from input value Monday Jan 16 2:14 AM ()
{% set link = calendar_link('google', node.title, node.field_date_range.start_date|date(format='l M j g:i A'), node.field_date_range.end_date|date(format='l M j g:i A'), node.body) %}
<a href="{{ link }}">Add to calendar</a>
I tried to convert the date to ISO 8601
I get the error Could not get date and time from input value 2023-01-16T02:14:26-05:00 ()
{% set link = calendar_link('google', node.title, node.field_date_range.start_date|date("c"), node.field_date_range.end_date|date("c"), node.body) %}
<a href="{{ link }}">Add to calendar</a>
Postponed: needs info
2.1
Miscellaneous
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Old issue but same source. Patch can be found here:
https://www.drupal.org/project/calendar_link/issues/3392784#comment-1530...
π
calendar_link() fails silently if date is string but can't be parsed
Active