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

[SITE] display time in local user time zone #14405

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

toshywoshy
Copy link
Contributor

@toshywoshy toshywoshy commented Jul 29, 2024

Fixes #9819

  • add local user time zone
  • add offset from UTC to convert
  • convert event time to user time zone
  • add several examples to demo

This solves issue #9819 and provides a way to display user local time for the program for start_time and end_time.
It uses the users browser defined time zone, and provide the timezone name and the time based.
An event needs to add timeoffset: "+0200" to indicate the offset of the timezone against UTC.
Please note that this value needs to be quoted as a string.
Here are some examples, which have also added into this commit

  • London : +0100
  • Rio de Janero : -0300
  • Denver : -0600

- add local user time zone
- add offset from UTC to convert
- convert event time to user time zone
- add several examples to demo

Signed-off-by: Toshaan Bharvani <[email protected]>
@toshywoshy toshywoshy requested review from a team as code owners July 29, 2024 14:42
Copy link

netlify bot commented Jul 29, 2024

Deploy Preview for devopsdays-web ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 6d65933
🔍 Latest deploy log https://app.netlify.com/sites/devopsdays-web/deploys/66e814e7b4cc4c0008a01aef
😎 Deploy Preview https://deploy-preview-14405--devopsdays-web.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@mattstratton
Copy link
Member

An event needs to add timeoffset: "+0200" to indicate the offset of the timezone against UTC.

What happens with events that do not have the offset?

@toshywoshy
Copy link
Contributor Author

toshywoshy commented Jul 30, 2024

Program for devopsdays organiser-summit 2024
If Open Space is new to you, you may be interested in more details about Open Space. Schedule is subject to change and more details will be added periodically Color Keys: Talk Ignite Open Space
Program for devopsdays Denver 2024
Program for for devopsdays Rio 2024

@phrawzty
Copy link
Collaborator

phrawzty commented Aug 4, 2024

What happens if there's a summer/winter time shift during an event?

@toshywoshy
Copy link
Contributor Author

If you use timezone it will display the summer/winter time correctly, as the offset gets calculated
If you use offset, then it will be in summer of winter time based upon the entry and the change will not be automatic

@mattstratton
Copy link
Member

This seems good! There's a merge conflict that needs resolution @toshywoshy and then I'll merge it

We do need to update the REFERENCE.md with the new fields too.

@mattstratton
Copy link
Member

There's a merge conflict that needs resolution

I think i fixed that :)

@@ -65,6 +65,8 @@ All dates are in unquoted YYYY-MM-DD, like this: `variable: 2016-01-05`, or like
|-------------------------|------------|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------|
| `startdate` | YYYY-MM-DD | No | The start date of your event. Leave blank if you don't have a venue reserved yet. | 2016-01-05 |
| `enddate` | YYYY-MM-DD | No | The end date of your event. Leave blank if you don't have a venue reserved yet. | 2016-01-05 |
| `timeoffset` | YYYY-MM-DD | No | The offset of the timezone of your event from UTC | "-0600" |
| `timezone` | YYYY-MM-DD | No | The timezone of the event | "Europe/London" |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@toshywoshy probably good to clarify the acceptable values (point to a website that has the list, etc? not sure where!)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The list of acceptable timezone values are here (column TZ identifier): https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List

Copy link
Contributor Author

@toshywoshy toshywoshy Sep 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, @mattstratton while I presumed we all know the correct TZ identifiers, it needs to be specified in the documentation, as some of them are not always as straightforward
As @jerdog already pointed out Wikipedia has a list of acceptable values.
I have updated the reference file accordingly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for time zones for program, events, etc
4 participants