Provide a clean formatter for next instance only

Created on 29 July 2022, over 2 years ago
Updated 10 June 2024, 6 months ago

Problem/Motivation

There is no formatter for recurring dates that produces the next instance in a format that can be understood by a spreadsheet.

Steps to reproduce

Make a View of recurring dates that displays the next instance. Copy and paste the resulting values into a spreadsheet. Attempt to sort these values.

Proposed resolution

Provide a new formatter that outputs just the next instance in a format customizable with a standard PHP DateTime string.

Remaining tasks

Remove the extraneous code from this formatter. I deleted what I was pretty sure was extra, but I probably missed some things.

✨ Feature request
Status

Needs review

Version

4.1

Component

Smart Date Recur

Created by

πŸ‡ΊπŸ‡ΈUnited States BenStallings

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States BenStallings

    If the timezone is a null string, change it to a null value.

  • πŸ‡¨πŸ‡¦Canada plousia

    Is this formatter intended to allow sorting of a view by the next date instance? I couldn't figure out how to get it working, if so. Checking "force chronological" in the field configuration didn't seem to do anything. Any sorts applied still seem to be working on the first instance, rather than next upcoming.

  • πŸ‡¨πŸ‡¦Canada mandclu

    @plousia the force chronological setting will only yield a visible difference within the output of a single node, if you have multiple recurrence rules that overlap.

    If you only want to show the next instance, you can configure the recur formatter to only 1 show upcoming instance and no past instances, and turn on the option to show the next instance separately. It will still output the recurring rule, but if you don't want that you can override the twig template.

  • πŸ‡¨πŸ‡¦Canada plousia

    Thanks, as it turned out my sorting issue was the aggregation setting on the date field filter. I was already outputting only the next instance in Twig.

  • πŸ‡ΊπŸ‡ΈUnited States BenStallings

    Here's an updated patch that changes $query->get() to $query->all() for compatibility with Symfony 6.

  • πŸ‡ΊπŸ‡ΈUnited States BenStallings

    dang it, forgot the attachment. Here is the attachment for comment #9.

Production build 0.71.5 2024