[gnome-shell/gnome-40] dateMenu: Ignore the allDay property of an event



commit 7761e5ce092357dd0167566189699cdbedff244b
Author: Sebastian Keller <skeller gnome org>
Date:   Thu Nov 4 12:48:26 2021 +0100

    dateMenu: Ignore the allDay property of an event
    
    Given the correct end date this code would be able to determine this
    correctly itself and doesn't need to rely on that property. And events
    without correct end dates are currently not shown anyway. This prepares
    for removing the allDay property entirely.
    
    This also fixes events going from 13:00 the current day to 01:00 not
    showing "...". It also fixes multi-day events wrongly detected as
    all-day events by the calendar-server showing up as "All day", despite
    only covering 1 hour of the day.
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2023>
    (cherry picked from commit d8efce0ffd75cce4322d846ad5216eab3137a789)

 js/ui/dateMenu.js | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/dateMenu.js b/js/ui/dateMenu.js
index f235ba38a2..6edd790a05 100644
--- a/js/ui/dateMenu.js
+++ b/js/ui/dateMenu.js
@@ -170,8 +170,8 @@ class EventsSection extends St.Button {
     }
 
     _formatEventTime(event) {
-        const allDay = event.allDay ||
-            (event.date <= this._startDate && event.end >= this._endDate);
+        const allDay =
+            event.date <= this._startDate && event.end >= this._endDate;
 
         let title;
         if (allDay) {
@@ -185,13 +185,13 @@ class EventsSection extends St.Button {
         }
 
         const rtl = Clutter.get_default_text_direction() === Clutter.TextDirection.RTL;
-        if (event.date < this._startDate && !event.allDay) {
+        if (event.date < this._startDate) {
             if (rtl)
                 title = '%s%s'.format(title, ELLIPSIS_CHAR);
             else
                 title = '%s%s'.format(ELLIPSIS_CHAR, title);
         }
-        if (event.end > this._endDate && !event.allDay) {
+        if (event.end > this._endDate) {
             if (rtl)
                 title = '%s%s'.format(ELLIPSIS_CHAR, title);
             else


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]