Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scheduled Content shortcode returns wrong NextOccurrenceDateTime value #4741

Closed
1 task done
JRichmond27 opened this issue Jul 12, 2021 · 2 comments
Closed
1 task done
Labels
Status: Confirmed It's clear what the subject of the issue is about, and what the resolution should be. Topic: CMS Related to data and components primarily for the external website. Topic: Lava Related to the Lava templating language. x-Fixed in v12.5
Milestone

Comments

@JRichmond27
Copy link

JRichmond27 commented Jul 12, 2021

Prerequisites

A Picture Is worth a Thousand Words

image

Description

When a recurring schedule is currently live, the Scheduled Content lava shortcode returns the wrong value for NextOccurrenceDateTime. Instead of returning the date and time of the start of the next occurrence, it returns the date and time of the end of the next occurrence instead.

When the schedule is not live, the returned value contains the correct next start time.

Steps to Reproduce

  1. Create a recurring schedule that starts 30 minutes before the current time with a duration of 1 hour
  2. Create an HTML block and add the following lava. Replace the scheduleid value with the ID of your new schedule.
Current Datetime: {{ 'Now' | Date:'M/d/yyyy h:mm tt' }}<br><br>
<strong>Scheduled Content Output:</strong><br>
{[ scheduledcontent scheduleid:'26' showwhen:'both' ]}
    Schedule: {{ Schedule.Name }}<br>
    IsLive: {{ IsLive }}<br>
    OccurrenceEndDateTime: {{ OccurrenceEndDateTime }}<br>
    NextOccurrenceDateTime: {{ NextOccurrenceDateTime }}
{[ endscheduledcontent ]}
  1. Save the block, reload and notice that the schedule is live and the next occurrence date time actually lists the ending time for the next occurrence

Expected behavior:

If I'm understanding the shortcode's documentation correctly, when a schedule is live, the NextOccurrenceDateTime value should show the start time of the next occurrence

Actual behavior:

The NextOccurrenceDateTime value shows the end time of the next occurrence

Versions

  • Rock Version: Rock McKinley 12.4 (1.12.4.1)
  • Client Culture Setting: en-US
  • Also tested on demo site: Rock McKinley 12.2 (1.12.2.2)
@cwomack cwomack added the Status: Confirmed It's clear what the subject of the issue is about, and what the resolution should be. label Jul 12, 2021
cwomack pushed a commit that referenced this issue Jul 12, 2021
@cwomack cwomack added x-Fixed in v12.5 Topic: CMS Related to data and components primarily for the external website. Topic: Lava Related to the Lava templating language. labels Jul 12, 2021
@cwomack cwomack closed this as completed Jul 12, 2021
@cwomack
Copy link
Contributor

cwomack commented Jul 12, 2021

@JRichmond27 Thank you for the clear steps, screenshot, and example shortcode to reproduce the issue.

@JRichmond27
Copy link
Author

@cwomack Absolutely! Thank you for fixing it so quickly!

@crayzd92 crayzd92 added this to the v12 milestone Jan 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Confirmed It's clear what the subject of the issue is about, and what the resolution should be. Topic: CMS Related to data and components primarily for the external website. Topic: Lava Related to the Lava templating language. x-Fixed in v12.5
Projects
None yet
Development

No branches or pull requests

3 participants