https://bugs.kde.org/show_bug.cgi?id=429892

--- Comment #3 from Gary Wang <wzc782970...@gmail.com> ---
> ...but I'm not familiar enough with different calendar systems and how they 
> are used to judge what is best.

Me too! So I think it could be good to discuss with more people so we can know
more about how alternate calendar system works before we start to code an
implementation into KDE. I'll write what I think at the end of this comment :D

> 1. Create a plugin for the existing event plugin system. This could show 
> entries from the alternate calendar as events in the gregorian calendar. 
> Relatively easy to do, but probably not very nice

Yep that's easy to do but clearly not a good way to address the alternate
calendar need.

> 2. Create a new plugin system that allows to draw overlay labels over the 
> gregorian calendar. That could look like in your screenshot.

That could solve the problem but this solution seems too generic/wide.
Alternate calendar is not a vary specialization need in Mainland China (In
Google Calendar android app, the alternate calendar option have 9 options to
choose alone with a "none" option), so I think maybe a plugin system design to
add alternate calendar support could be great, and other project like calindori
can also get benefit from the plugin system or API design.

> 3. Create a new applet as alternative to the current one. This could reuse 
> parts of the underlying system, e.g. the events plugin system. That would 
> have the biggest flexibility in terms of presentation

That's what I'm doing currently (mainly for test the feasibility of the API
design of what I am thinking), but I think since "adding a place to display
alternate calendar date text" is a pretty minor change from the current Date
and Time plugin, writing a new applet will not be a good way to do if we
intended to get this feature into KDE. 

--------------

The alternate calendar means we can display two calendar system at the same
time. The basic layout of a month view with alternate calendar enable will be
the same as the one if we don't have alternate calendar enabled, but if
alternate calendar is enabled, the date text will be able to show up in the day
grid (just like the way what my screenshot did).

According to
https://support.microsoft.com/en-us/office/display-an-alternate-calendar-8cb201d4-c175-4d9e-9d8f-b4df00ca8f82
, the alternate calendar feature are enabled if the language are set to Arabic,
English, Hebrew, Hindi, Chinese, Japanese, Korean, or Thai. Also in Google
Clander app, there are also 9 options can be used as an alternate calendar.
Also, both Google Calendar and the one from Microsoft are not treat alternate
calendar as regular calendar event, so I think reuse the existing event plugin
system is not a good idea.

For what I think, we could make the current Date and Time applet display
alternate calendar day text in the same grid together with the main calendar
date text if an alternate calendar system is available and enabled, and keep it
looks exact the same like the current one if no alternate calendar is enabled.
At the current state, we only need to change DayDelegate.qml and add adjust the
behavior of last Components.Label{}. What I did is
https://github.com/BLumia/pineapple-calendar/blob/7fc57a470fecad57d07a79d02e54a6e2febea4e2/plasmoid/package/contents/ui/calendar/DayDelegate.qml#L103
but I'm not sure if that's a good approach. In my current implementation, only
one c++ interface are used
https://github.com/BLumia/pineapple-calendar/blob/7fc57a470fecad57d07a79d02e54a6e2febea4e2/plasmoid/calendar.cpp#L24
. The `alternateCalendarDayText(day, month, year)` accepts a date in current
main calendar, and returns the string which should be display under the day
grid according to what the (currently hard-coded) alternate calendar is used.

But I think the biggest challenge here is design a good C++ API for alternate
calendar plugins. Since the main goal is letting an existed calendar
application know what text to display under the main calendar's date name, so I
guess we don't need to design a list of interface to provide full capability of
calendar system date and time calculating. Here
(https://github.com/BLumia/pineapple-calendar/blob/master/lib/pabstructcalendar.h)
are a list of interface I have tried in my current implementation, there are
still some other thing not covered in this current implementation, I'll do some
more resources and write more about what I think about the API design later.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to