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

Community Events page has a difficult to understand format #905

Open
vanderaj opened this issue Mar 13, 2024 · 9 comments
Open

Community Events page has a difficult to understand format #905

vanderaj opened this issue Mar 13, 2024 · 9 comments
Assignees
Labels
enhancement New feature or request related to the improvement of this project and its resources repo Issues or PRs related to the improvement or automation of this repository

Comments

@vanderaj
Copy link
Member

The code that generates a list of community events from Meetup:

pages/social/community_events.md

generates output like:

image

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)

@kingthorin kingthorin added enhancement New feature or request related to the improvement of this project and its resources repo Issues or PRs related to the improvement or automation of this repository labels Mar 13, 2024
@ChandraDevs1
Copy link

can i work on it

@kingthorin
Copy link
Contributor

Go for it!

@justtcallmejayy
Copy link

justtcallmejayy commented Jan 17, 2025

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

@kingthorin
Copy link
Contributor

I'd suggest Time: 10:30 am (America/Toronto) then you don't have to worry about, ex: EST vs EDT.

@justtcallmejayy
Copy link

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!

@kingthorin
Copy link
Contributor

It seems that's literally the data in the file.

If someone knew what the solution was they already would have opened a PR.

@kingthorin
Copy link
Contributor

It's not exactly pretty (code wise) but this is workable:
(Ignore the misplaced pink highlight on the first one.)
Image

Image

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 }}

@justtcallmejayy
Copy link

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!

@kingthorin
Copy link
Contributor

kingthorin commented Jan 27, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request related to the improvement of this project and its resources repo Issues or PRs related to the improvement or automation of this repository
Projects
None yet
Development

No branches or pull requests

4 participants