mitodl / mit-learn

BSD 3-Clause "New" or "Revised" License
0 stars 2 forks source link

separate starts and as taught in, show anytime availability #1828

Closed gumaerc closed 1 week ago

gumaerc commented 2 weeks ago

What are the relevant tickets?

Closes https://github.com/mitodl/hq/issues/6075

Description (What does it do?)

This PR revises the logic surrounding dates. Previously, we were showing either the "Starts" or "As taught in" fields, based on the output of shouldShowAnytime. This function takes a LearningResource and returns true if its availability property is set to "anytime" and its resource_type is "course" or "program." Now, if availability is "anytime" then the "Starts" field will show "Anytime," otherwise it will show the start dates. The "As taught in" field also appears if availability is "anytime," but if no dates are returned from totalRunsWithDates, then it will be hidden.

Screenshots (if appropriate):

image image

How can this be tested?