davidportillo / tenorwebsite

1 stars 1 forks source link

get date dynamically #15

Open fpigeonjr opened 7 years ago

fpigeonjr commented 7 years ago

Dynamic Dates

Dates are currently being set using Jekkyl's site.time. Would like to move to a dynamic solution that doesn't rely on the site being built every month to update the calendar items.

example code from _includes/home-calendar

{% assign current_time = site.time | date: "%s" %}
{% assign event_count = 0 %}

{% for calendar in site.categories['calendar'] reversed %}
   {% assign upcoming_event = calendar.date-end | date: '%s' %}
   {% if upcoming_event >= current_time and event_count < 3 %}
        ...
       {% assign event_count = event_count | plus:1 %}
    {% endif %}
{% endfor %}

Files Affected

pcast01 commented 7 years ago

Frank! Got a question. The requirement you have is that if what ever the current month is then show only performances that are past that month right?

fpigeonjr commented 7 years ago

Thanks for the question. I will have to expand based on the two different files affected. We have to get more specific than month since we would want to not want to show events that have passed in the upcoming schedule. I think getting the day would be specific enough.

Homepage Calendar

_includes/home-calendar the requirement is to show the next 3 upcoming shows. We would want to show the event if it was today but not show yesterdays events.

Calendar

calendar.html file has two separate calendars break outs.

upcoming schedule

This calendar shows the upcoming/future events in chronological order grouped by year.

past performances

This calendar shows past events in reverse chronological order grouped by year.