Community Events page has a difficult to understand format
The code that generates a list of community events from Meetup:
pages/social/community_events.md
generates output like:
This is confusing, as the end time is not 4 pm, but another time entirely. This is actually saying the time zone in the image.
Could the time zone be separated out and made more obvious?
Time: 10:30 (-4 America/Toronto)
or just
Time: 10:30 am (America/Toronto)
Go for it!
Thank you for pointing this out, I can see this issue is still unresolved. I understand the issue and agree that separating the time zone and making it more explicit would improve clarity for users. I’ll start working on updating the time formatting to include the time zone in a more user-friendly format, such as:
Time: 10:30 am (America/Toronto)
or
Time: 10:30 (-4 America/Toronto)
I’ll make the necessary adjustments and test the output to ensure accuracy. Please let me know if you have a preference for the exact format! Also, Can you please assign me this issue it would be great @vanderaj @kingthorin
I'd suggest Time: 10:30 am (America/Toronto) then you don't have to worry about, ex: EST vs EDT.
I attempted to resolve the issue using the code:
Time: {{ event.date | append: "T" | append: event.time | date: "%I:%M %p" }} ({{ event.timezone }})
However, the output remains in the format Time: 19:00+01:00 (Europe/Berlin). Despite testing multiple variations, the desired format (e.g., Time: 7:00 pm (Europe/Berlin)) is not displaying correctly. Could someone confirm if there’s an issue with the liquid templating or point out where adjustments may be needed?
Thank you!
It seems that's literally the data in the file.
If someone knew what the solution was they already would have opened a PR.
It's not exactly pretty (code wise) but this is workable:
(Ignore the misplaced pink highlight on the first one.)
iff --git a/pages/social/community_events.md b/pages/social/community_events.md
index 36352cd..b2600cc 100644
--- a/pages/social/community_events.md
+++ b/pages/social/community_events.md
@@ -41,7 +41,20 @@ permalink: meetings/
{% endif %}
### Event: <a name="{{ i }}_item">{{ event.name }} </a>
#### Group: [{{ event.group }}](/{{ event.repo }}/)
-#### Time: {{ event.time }} ({{ event.timezone }})
+{% if event.time contains '-' %}
+ {% assign timeparts = event.time | split: '-' %}
+ {% if timeparts.size > 0 %}
+ {% assign displaytime = timeparts[0] | append: " (-" | append: timeparts[1] | append: ' ' | append: event.timezone | append: ')' %}
+ {% endif %}
+{% endif %}
+
+{% if event.time contains '+' %}
+ {% assign timeparts = event.time | split: '+' %}
+ {% if timeparts.size > 0 %}
+ {% assign displaytime = timeparts[0] | append: " (+" | append: timeparts[1] | append: ' ' | append: event.timezone | append: ')' %}
+ {% endif %}
+{% endif %}
+#### Time: {{ displaytime }}
#### Link: [{{ event.link }}]({{ event.link }})
<div>
<strong>Description</strong>: {{ event.description }}
I’ve implemented the following logic for handling the time formatting:
{% if event.time contains '-' %}
{% assign timeparts = event.time | split: '-' %}
{% assign displaytime = timeparts[0] | append: " (-" | append: timeparts[1] | append: " " | append: event.timezone | append: ")" %}
{% elsif event.time contains '+' %}
{% assign timeparts = event.time | split: '+' %}
{% assign displaytime = timeparts[0] | append: " (+" | append: timeparts[1] | append: " " | append: event.timezone | append: ")" %}
{% else %}
{% assign displaytime = event.time %}
{% endif %}
#### Time: {{ displaytime }}
However, the output remains unchanged and still displays the original format like Time: 19:00+01:00 (Europe/Berlin). Despite testing different approaches, the expected format, such as Time: 7:00 pm (Europe/Berlin), does not render correctly. i also tried on multiple devices such as on mac OS, later on the GITHUB CODESPACE, that took my 5-6 days on this issue and yet it is still unsolved. Please direct me if I am in wrong direction.
Could someone confirm if there’s any additional processing step or data issue that could be affecting this? Any guidance would be greatly appreciated!
Thank you!
I'm not sure how you tested it. The example I provided was checked in a local testing server. https://OWASP.org/migration has details