leits / MeetingBar

πŸ‡ΊπŸ‡¦ Your meetings at your fingertips in the macOS menu bar
https://meetingbar.app
Apache License 2.0
4.43k stars 191 forks source link

Bug: All-day align event titles misaligned in AM/PM mode #513

Closed kofigumbs closed 1 year ago

kofigumbs commented 1 year ago

App version 4.0.6

Installation source

Describe the bug The all-day event title is aligned in the middle of "second column" with the end times.

To Reproduce Steps to reproduce the behavior:

  1. Set Appearance > Menu > Time format setting to 12-hour AM/PM
  2. Setup an all-day meeting and a normal meeting for today
  3. See menu alignment issue

Expected behavior

The all-day event title should be aligned in the "third column" with the other event titles.

Screenshots

Screen Shot 2022-10-05 at 11 35 15 AM

Desktop (please complete the following information):

Additional context

I think the resolution would be to change this bit

https://github.com/leits/MeetingBar/blob/35481c9832e0023c19e0db9779feedbc4e34b248/MeetingBar/StatusBarItemController.swift#L643-L649

To read like this

        if event.isAllDay {
            eventStartTime = "status_bar_event_start_time_all_day".loco()
            switch Defaults[.timeFormat] {
            case .am_pm:
                eventEndTime = "\t\t\t"
            case .military:
                eventEndTime = "\t"
            }
        } else {
            eventStartTime = eventTimeFormatter.string(from: event.startDate)
            eventEndTime = eventTimeFormatter.string(from: event.endDate)
        }

I'm just guessing it's 3 tabs based on the visual. I can test it and submit a PR with the change if that'd be helpful.

leits commented 1 year ago

Thanks, @kofigumbs! Your guess was right, added your solution with two spaces and it works as expected! I'll include the fix in the next release πŸ‘