mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
Calendar: events tooltip use fixed font with improved time formating
This commit is contained in:
@@ -604,18 +604,19 @@ SmartPanel {
|
||||
const events = parent.parent.parent.parent.getEventsForDate(modelData.year, modelData.month, modelData.day)
|
||||
if (events.length > 0) {
|
||||
const summaries = events.map(event => {
|
||||
if (isAllDayEvent(event)) {
|
||||
return event.summary
|
||||
} else {
|
||||
const start = new Date(event.start * 1000)
|
||||
const startFormatted = start.toLocaleTimeString(I18n.locale, Locale.ShortFormat)
|
||||
const end = new Date(event.end * 1000)
|
||||
const endFormatted = end.toLocaleTimeString(I18n.locale, Locale.ShortFormat)
|
||||
return `${startFormatted}-${endFormatted} ${event.summary}`
|
||||
}
|
||||
}).join('\n')
|
||||
TooltipService.show(Screen, parent, summaries)
|
||||
TooltipService.updateText(summaries)
|
||||
if (isAllDayEvent(event)) {
|
||||
return event.summary
|
||||
} else {
|
||||
// Always format with '0' padding to ensure proper horizontal alignment
|
||||
const timeFormat = Settings.data.location.use12hourFormat ? "hh:mm AP" : "HH:mm"
|
||||
const start = new Date(event.start * 1000)
|
||||
const startFormatted = I18n.locale.toString(start, timeFormat)
|
||||
const end = new Date(event.end * 1000)
|
||||
const endFormatted = I18n.locale.toString(end, timeFormat)
|
||||
return `${startFormatted}-${endFormatted} ${event.summary}`
|
||||
}
|
||||
}).join('\n')
|
||||
TooltipService.show(screen, parent, summaries, "auto", Style.tooltipDelay, Settings.data.ui.fontFixed)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user