-
-
Notifications
You must be signed in to change notification settings - Fork 658
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
[DRAFT] PLIP #5629: Enhance timezone support in UI for plone.app.event
based types
#5629
Comments
The REST API endpoint for the event content type also lacks a 'timezone' attribute(as simply returning the datetime with the timezone information may cause problems) so, I believe that should also be added in the IEventBasic schema. |
@IshaanDasgupta thanks for the feedback. However I think the The Plone REST API does not return the timezone information for the event start and end attributes, according to this example. |
Yes, the IEventBasic does have the timezone of the event stored internally but, when return HTTP response in plone.restapi, this timezone info is lost during the conversion of the date to UTC by datetimelike_to_iso function And as this is a generalised function, modifying it would make all the dates to be returned with their original timezone which would cause problems as in volto, we are using moment and it does not directly take the timezone into account. So, all the datetimes would suddenly change by some amount. Hence, I thought that adding a separate 'timezone' attribute would be better as then, we could gradually implement the changes without breaking anything. Also, we don't really need to store this information, as you said the timezone is already stored, we just need to calculate the timezone and return it in the REST API response. Do you know any other ways by which this can be achieved ? |
If we decide that this PLIP will be released in Plone 7.0, then it is OK to break stuff. It is up for discussion whether Moment.js is harmful or beneficial. I would like to get more opinions. Moment.js with timezone is an option. However, I am wary of duplicating what already comes with the Plone backend. What does Moment.js add? Was this a case of frontend developers not understanding what the backend does? That's not a rhetorical question, I really don't know. Why is it used? The Volto Release Notes don't explain why it is used. |
here, moment.js can be used a bridge between backend n frontend for fetching user timezone, converting meeting time and updating notification content. And specifically speaking about the issue which I rose , it was for the better UX( a simple scroll for years and months) |
I would strongly encourage anyone in support of moment.js to read its Project Status. The arguments against its use are compelling, making its inclusion something I think is neither needed nor wanted. An important factor is saving 30Kb, especially where Internet speeds are slow. |
From a discussion in the Community Forum:
|
Yes I agree too that localised timings would be beneficial. And python can
be used for this purpose , by this space can also be optimised. I have
personally worked with this, it is good.
@stevepiercy is your email linked to the GitHub, as I messaged you in email
and you deleted the comment from GitHub.
…On Tue, Jan 23, 2024, 02:38 Steve Piercy ***@***.***> wrote:
From a discussion in the Community Forum
<https://community.plone.org/t/issue-in-running-a-command/18598/19?u=stevepiercy>
:
It has not yet been decided or discussed how to display [a datetime] to
the end user, other than include a timezone. I imagine that a localized
datetime with timezone would be preferred, and Python has great support
for formatting dates
<https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes>.
A preferred format could be configured in the Date and Time Settings
control panel <https://classic.demo.plone.org/@@dateandtime-controlpanel>
with an arbitrary format code.
—
Reply to this email directly, view it on GitHub
<#5629 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/BBN43VNUVUXU5ANAHAG5Y5DYP3IL7AVCNFSM6AAAAABB4NGH6SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMBUHAYTSMRQGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@stevepiercy I think that this PLIP has to be thought globally on the context of whole Plone itself, analyzing how the data is saved in Plone and then how it is exposed through the REST API and then how it is shown in Volto and also a Classic UI. In the past we talked about how to expose the dates in the REST API, but we should revisit and document everything clearly. |
Sorry for the noise, I clicked the wrong button |
@sneridagh would you please move this item on the Volto Roadmap from Done to uh... Not Done? I reverted the other project board automatic updates. @erral I thought I captured your general concerns in this PLIP. If not, please let me know what I can do to revise the PLIP accordingly. FYI, I've already had discussions with Classic UI and Volto Teams. There will be many more planning discussions, including at upcoming sprints even if remotely, over the next several months. |
@stevepiercy I know that there are also issues with effective and expiration dates, you link them in the explanation above, but I think that the timezone issue and handling changes should also be extended to those fields and I would even say that also to internal created and modified dates. I think that having timezone aware and not aware datetimes in the same content type, would be even a bigger nightmare. Anyway, no matter we finally include them in other datetime fields, a big +1 to the PLIP. |
As discussed in the Plone Steering Circle today, we will drop Python 3.8 and 3.9 support in Plone 6.1. Alpha 2 still officially supports them, but we will drop them in the next alpha. So from that point of view it will be fine to start using the |
This is an issue that discusses transition from pytz to zoneinfo in icalendar: collective/icalendar#609. @stevepiercy referred here in collective/icalendar#360 (reply in thread) |
Per a discussion with @jensens on the design document, we came up with a more concise and precise name of this PLIP: "Enhance timezone support in UI for |
plone.app.event
based types
|
This is how I let the user choose the timezone in the UI if the OpenWebCalendar: (I do not know if that is in any way useful for this PLIP.) |
Indeed it is useful. @thet and I discussed that one issue with plain old select menus is the huge number of options for timezones. A typeahead select would be an improvement upon this, both for Volto and Classic UI via mockup. |
I will watch what you are doing and it might be worth creating a separate library for this so it can be shared. When I was using the timezone choice in Etar (Android) I could not find my timezone. They just all had names like "British Summer Time" and so on. It would be cool to have one place that maps cities, timezone names, countries, GPS, ... and everything we can think of to timezones in a localized fashion. That could just be a set of JSON files that then can be exported into JS and Python modules and can be very useful also for Etar and other FOSS applications, with localization. |
For what is worth I support this PLIP. It is an incredibly complex topic. Maybe we need a dedicated sprint to bring people together to being able to move on. |
I intend to finalize the draft PLIP, its design document, and its own project board. We're about 80% done with the planning phase after Axolotl Sprint and Buschenschanksprint. |
[DRAFT] PLIP #TBD: Enhance timezone support in UI for
plone.app.event
based typesResponsible Persons
Proposer: Steve Piercy @stevepiercy
Seconder: Johannes Raggam @thet
Abstract
Event content types, or events, have incomplete implementations and sometimes slightly different implementations between the two Plone frontends, Classic UI and Volto. This PLIP proposes to improve the implementations to be more complete and consistent.
In Volto, the event content type does not display a timezone. When visitors are located or travel across multiple time zones, they cannot determine whether the event's time zone is their own local one, the site's default, the author's setting, or the event's location's. This is particularly confusing when an event has online participation, or when participants travel across time zones. In sites that serve its visitors in only one time zone, this is not an issue.
In Classic UI, the event contact type displays only those timezones that have been made available by the Site Administrator.
The history of event content types is in the
plone.app.event
package. However it was implemented usingpytz
whereas the standard libraryzoneinfo
anddatetime
with an optional third-party packagetzdata
are now recommended for Python 3.9 and later. From thepytz
readme:Plone 6.0 supports Python 3.8-3.11. Python support for Plone 6.1 and later is unknown at this time. When Python 3.8 support is dropped, we can use the standard library and
tzdata
instead. Plone 6.2 is expected to be released between October and December 2024, and Python 3.8's end of life is October 2024. It is unknown at this time whether Plone 6.2 will retain Python 3.8 support. Plone 7.0 is tentatively scheduled for release between April and June 2025, at which time Python 3.8 support would definitely be dropped. See Plone Release Schedule.See also PEP 615 – Support for the IANA Time Zone Database in the Standard Library and Talk - Benjamin "Zags" Zagorsky: Handling Timezones in Python.
Several other related minor issues may be addressed as part of this PLIP.
Motivation
Everyone wants to have a good time with a date. 😉
zoneinfo
is preferred overpytz
since Python 3.9.International audiences expect events to be held at a given date and time with a timezone designation. Consistency between the two frontends makes it easier to transition when upgrading Plone or migrating to Volto.
The following issues relate to the event content type, date, time, and timezone implementations.
Assumptions
Proposal and Implementation
This PLIP is targeted for Plone 6.2 or 7.0, whichever version drops support for Python 3.8 first.
In Classic UI, inputs for events should continue to use the Patterns Lib datetime picker with an HTML5 datetime-local input as fallback, which in turn falls back to an input type of text.
In Classic UI, evaluate dependencies of
plone.app.event
to determine whether they should be kept or replaced.In Volto, decide whether to continue to use its datetime widget—which consists of two text inputs, one each for the date and the time—or use a different implementation. The current implementation requires either keyboard input or an excessive number of clicks to select a specific month or year that is distant from the default. From #2392 (comment), there is a plan to move to React Aria, and we could use its calendar component with a styled calendar input with month and year selectors.
In addition to the resolution of the above issues, the following items would be addressed.
<date>
and<time>
HTML markup for date and time values when displayed.<input type="TYPE">
, whereTYPE
is either<input type="date">
,<input type="time">
, or<input type="datetime-local">
.Exclusions
There are other issues that do not involve the event content type, but are related to date, time, and timezone issues. These issues are not part of this PLIP, but are mentioned to make it clear that they are out of scope.
Deliverables
All the above issues with a checkbox, as well as the following items.
plone.app.event
documentation from Plone 5 to Plone 6.Project board
https://github.com/orgs/plone/projects/43/views/1
Risks
Switching from
pytz
to the Python 3.9 or greater standard library andtzdata
may cause compatibility issues.It is unknown which version of Plone will drop support of Python 3.8 when it goes end of life in October 2024.
Dependencies of
plone.app.event
might need to be upgraded or replaced.Returning a datetime with a timezone might cause issues in Volto,
plone.restapi
, andplone.app.event
.Removing detection of the browser's timezone in Volto may break entry and display of dates.
Participants
The text was updated successfully, but these errors were encountered: