- Issue created by @kristiantosney
- Status changed to Needs review
4 months ago 10:12am 28 August 2024 - π«π·France lazzyvn paris
This patch needs a lot of work
$this->smartDateElements($items, $langcode);
but methode smartDateElements has only $items without $langcode;
and errors with phpcs
395 | ERROR | [ ] Missing parameter comment
395 | ERROR | [x] Data types in @param tags need to be fully namespaced
397 | ERROR | [ ] Description for the @return value is missing
I think smartDate must have a service to get the date and end date, it must use the service if it exists -
lazzyvn β
committed 965224e6 on 4.x
Issue #3469868: Field formatter is incompatible with smart dates...
-
lazzyvn β
committed 965224e6 on 4.x
- Status changed to Fixed
3 months ago 8:14pm 6 September 2024 Automatically closed - issue fixed for 2 weeks with no activity.
- π¬π§United Kingdom kristiantosney
It doesn't work to just have smart dates using the existing date range method as the way days are stored is different so I'd advise either using what I've added in the patch or adding something of your own rather than just trying to use the existing date range method. I've added an updated patch to work with the change you made.
- π«π·France lazzyvn paris
why in your patch don't you check if value and end_date are not null?
i think it's better if you can apply the patch by checking $item->get('value') and $item->get('start_date')
something like this{ /** @var \Drupal\Core\Datetime\DrupalDateTime $start_date */ $start_date = $item->start_date ?? $item->value; /** @var \Drupal\Core\Datetime\DrupalDateTime $end_date */ $end_date = $item->end_date;
- First commit to issue fork.
- πΊπΈUnited States mark_fullmer Tucson
I'm also interested in providing support for smart_date type fields through this module, and am happy to test this. However, based on my review of the code and functional testing of the above patch, it appears that the scope of this issue is to handle date spans in smart_date fields only. As far as I can tell, there is still the more fundamental issue of supporting repeating/recurring date instances. It seems that the maintainer has suggested this is not supportable per β¨ Smart Date Support? Closed: won't fix .
Can @lazzyvn confirm whether there is openness to supporting recurring smart_date fields?
Can the @kristiantosney revise the issue description and title to better define the scope of the intended change here?
- πΊπΈUnited States mark_fullmer Tucson
*If* there was interest in supporting smart date recurring dates, this is a proof of concept for how the correct delta values could be retrieved. It would simply require the View to be configured to include a "delta" field from the smartdate field, and the code here would use that from the row output to find the correct delta.
Not expecting this to be incorporated as-is, of course. Just sharing to provoke ideas & consideration.
- π«π·France lazzyvn paris
smartdate works with ical date in base case (start/end date) another feature, i think smartDate has a service or method to get the correct date. I add code to development but I think there are other correct ways to get value.