When using the smart date contrib module, add to calendar does not provide the correct data to the calendar. Smart date stores dates as timestamps so these need some special handling.
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | add_to_calendar_smart_date_handling-3123887-13.patch | 1.21 KB | caesius |
Issue fork addtocalendar-3123887
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
selwynpolit commentedHere is a quick patch in case it is helpful to folks
Comment #3
selwynpolit commentedThis version of my patch will actually apply via composer. If you jam a local copy of it in a patches folder at the same level as composer.json
You will need to update your composer.json with the patch. See the example below:
Comment #4
selwynpolit commentedOk, here is the patch using the more appropriate naming convention so it can be applied from Drupal.org
Comment #5
gg24 commentedComment #6
smustgrave commentedPatch #4 seems to work for me.
Comment #7
smustgrave commentedRerolled the patch for 3.2
Comment #8
jdearie commentedTested #7 with Addtocalendar 3.2 and SmartDate 3.1
1) Added new field for add to calendar
2) Added its block to events display
3) Settings for field and calendar invite settings here (made the addtocalendar checkbox on by default and required)
4) Add to calendar Button shows up, and it creates the .ics file, but the date and/or time don't match.
The ICS created and downloaded fine, but my event was 9-10 and the ICS had 1123-1223 - not even close. I thought maybe it was a
timezone issue, but that wouldn't explain the minutes.
A separate example was an all day event for March 7 - the ICS showed the date as Feb 26 and a time from 9-10.
Has anyone else had success with the patch for 3.2?
Comment #9
vj2150 commentedThe patch doesn't work for me. I am trying on Drupal 9.
I see the following error in the log.
Error: Call to a member function getColumns() on bool in Drupal\Core\Entity\Query\Sql\Tables->addField()
Comment #10
nicoschi commentedPatch reroll working on Drupal 9.
Comment #11
sharique commentedThe patch at #10 is working, please note that it works best with [node:field_schedule:value] as token value.
Comment #12
gg24 commented@nicoschi,
I have reviewed your patch. I suggest few changes in the code.
1- Please use the ternary operator instead of if else
can be changed to
2- Unnecessary variable
can be changed to as $tz is only being used at one place.
Comment #14
caesius commentedUpdated to apply to latest 3.x-dev.
Comment #17
caesius commentedSwitched to using an MR. The crucial difference from the previous patches is the use of an
elseifso as not to overrideuse_raw_value.Comment #19
ckngPatch in #17 not working for me.
atcDateStart and atcDateEnd are always using the `use_raw_value`. Updated patch to correct the logic checking.