feat: add setting to show event start time in month view
This commit is contained in:
@@ -70,6 +70,7 @@ export function EventCard({ event, calendar, variant, onClick, onMouseEnter, onM
|
||||
const color = getEventColor(event, calendar);
|
||||
const startDate = parseISO(event.start);
|
||||
const timeFormat = useSettingsStore((state) => state.timeFormat);
|
||||
const showTimeInMonthView = useSettingsStore((state) => state.showTimeInMonthView);
|
||||
const timeFmt = timeFormat === "12h" ? "h:mm a" : "HH:mm";
|
||||
|
||||
const calendarName = calendar?.name || "";
|
||||
@@ -156,6 +157,9 @@ export function EventCard({ event, calendar, variant, onClick, onMouseEnter, onM
|
||||
style={{ backgroundColor: `${color}24`, borderLeft: `3px solid ${color}`, color, ...style }}
|
||||
>
|
||||
<div className="flex items-center gap-1 min-w-0">
|
||||
{showTimeInMonthView && !event.showWithoutTime && (
|
||||
<span className="flex-shrink-0 opacity-80">{format(startDate, timeFmt)}</span>
|
||||
)}
|
||||
<span className="truncate font-medium">{event.title || t("events.no_title")}</span>
|
||||
</div>
|
||||
</button>
|
||||
|
||||
@@ -14,6 +14,7 @@ export function CalendarSettings() {
|
||||
const {
|
||||
timeFormat,
|
||||
firstDayOfWeek,
|
||||
showTimeInMonthView,
|
||||
calendarNotificationsEnabled,
|
||||
calendarNotificationSound,
|
||||
calendarInvitationParsingEnabled,
|
||||
@@ -57,6 +58,16 @@ export function CalendarSettings() {
|
||||
/>
|
||||
</SettingItem>
|
||||
|
||||
<SettingItem
|
||||
label={t('show_time_in_month_view')}
|
||||
description={t('show_time_in_month_view_desc')}
|
||||
>
|
||||
<ToggleSwitch
|
||||
checked={showTimeInMonthView}
|
||||
onChange={(checked) => updateSetting('showTimeInMonthView', checked)}
|
||||
/>
|
||||
</SettingItem>
|
||||
|
||||
<SettingItem
|
||||
label={t('notifications_enabled')}
|
||||
description={t('notifications_enabled_desc')}
|
||||
|
||||
@@ -1826,7 +1826,9 @@
|
||||
"notification_sound": "Notification sound",
|
||||
"notification_sound_desc": "Play a sound for calendar alerts",
|
||||
"invitation_parsing": "Parse email invitations",
|
||||
"invitation_parsing_desc": "Detect calendar invitations in email attachments and show calendar actions"
|
||||
"invitation_parsing_desc": "Detect calendar invitations in email attachments and show calendar actions",
|
||||
"show_time_in_month_view": "Show start time in month view",
|
||||
"show_time_in_month_view_desc": "Display the event start time alongside the title in month view"
|
||||
},
|
||||
"days": {
|
||||
"monday": "Monday",
|
||||
|
||||
@@ -106,6 +106,9 @@ interface SettingsState {
|
||||
sessionTimeout: number; // minutes (0 = never)
|
||||
trustedSenders: string[]; // Email addresses that can load external content
|
||||
|
||||
// Calendar
|
||||
showTimeInMonthView: boolean;
|
||||
|
||||
// Calendar Notifications
|
||||
calendarNotificationsEnabled: boolean;
|
||||
calendarNotificationSound: boolean;
|
||||
@@ -201,6 +204,9 @@ const DEFAULT_SETTINGS = {
|
||||
sessionTimeout: 0, // Never
|
||||
trustedSenders: [] as string[],
|
||||
|
||||
// Calendar
|
||||
showTimeInMonthView: false,
|
||||
|
||||
// Calendar Notifications
|
||||
calendarNotificationsEnabled: true,
|
||||
calendarNotificationSound: true,
|
||||
@@ -281,6 +287,7 @@ export const useSettingsStore = create<SettingsState>()(
|
||||
sendConfirmation: state.sendConfirmation,
|
||||
defaultReplyMode: state.defaultReplyMode,
|
||||
sessionTimeout: state.sessionTimeout,
|
||||
showTimeInMonthView: state.showTimeInMonthView,
|
||||
calendarNotificationsEnabled: state.calendarNotificationsEnabled,
|
||||
calendarNotificationSound: state.calendarNotificationSound,
|
||||
calendarInvitationParsingEnabled: state.calendarInvitationParsingEnabled,
|
||||
|
||||
Reference in New Issue
Block a user