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 color = getEventColor(event, calendar);
|
||||||
const startDate = parseISO(event.start);
|
const startDate = parseISO(event.start);
|
||||||
const timeFormat = useSettingsStore((state) => state.timeFormat);
|
const timeFormat = useSettingsStore((state) => state.timeFormat);
|
||||||
|
const showTimeInMonthView = useSettingsStore((state) => state.showTimeInMonthView);
|
||||||
const timeFmt = timeFormat === "12h" ? "h:mm a" : "HH:mm";
|
const timeFmt = timeFormat === "12h" ? "h:mm a" : "HH:mm";
|
||||||
|
|
||||||
const calendarName = calendar?.name || "";
|
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 }}
|
style={{ backgroundColor: `${color}24`, borderLeft: `3px solid ${color}`, color, ...style }}
|
||||||
>
|
>
|
||||||
<div className="flex items-center gap-1 min-w-0">
|
<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>
|
<span className="truncate font-medium">{event.title || t("events.no_title")}</span>
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ export function CalendarSettings() {
|
|||||||
const {
|
const {
|
||||||
timeFormat,
|
timeFormat,
|
||||||
firstDayOfWeek,
|
firstDayOfWeek,
|
||||||
|
showTimeInMonthView,
|
||||||
calendarNotificationsEnabled,
|
calendarNotificationsEnabled,
|
||||||
calendarNotificationSound,
|
calendarNotificationSound,
|
||||||
calendarInvitationParsingEnabled,
|
calendarInvitationParsingEnabled,
|
||||||
@@ -57,6 +58,16 @@ export function CalendarSettings() {
|
|||||||
/>
|
/>
|
||||||
</SettingItem>
|
</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
|
<SettingItem
|
||||||
label={t('notifications_enabled')}
|
label={t('notifications_enabled')}
|
||||||
description={t('notifications_enabled_desc')}
|
description={t('notifications_enabled_desc')}
|
||||||
|
|||||||
@@ -1826,7 +1826,9 @@
|
|||||||
"notification_sound": "Notification sound",
|
"notification_sound": "Notification sound",
|
||||||
"notification_sound_desc": "Play a sound for calendar alerts",
|
"notification_sound_desc": "Play a sound for calendar alerts",
|
||||||
"invitation_parsing": "Parse email invitations",
|
"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": {
|
"days": {
|
||||||
"monday": "Monday",
|
"monday": "Monday",
|
||||||
|
|||||||
@@ -106,6 +106,9 @@ interface SettingsState {
|
|||||||
sessionTimeout: number; // minutes (0 = never)
|
sessionTimeout: number; // minutes (0 = never)
|
||||||
trustedSenders: string[]; // Email addresses that can load external content
|
trustedSenders: string[]; // Email addresses that can load external content
|
||||||
|
|
||||||
|
// Calendar
|
||||||
|
showTimeInMonthView: boolean;
|
||||||
|
|
||||||
// Calendar Notifications
|
// Calendar Notifications
|
||||||
calendarNotificationsEnabled: boolean;
|
calendarNotificationsEnabled: boolean;
|
||||||
calendarNotificationSound: boolean;
|
calendarNotificationSound: boolean;
|
||||||
@@ -201,6 +204,9 @@ const DEFAULT_SETTINGS = {
|
|||||||
sessionTimeout: 0, // Never
|
sessionTimeout: 0, // Never
|
||||||
trustedSenders: [] as string[],
|
trustedSenders: [] as string[],
|
||||||
|
|
||||||
|
// Calendar
|
||||||
|
showTimeInMonthView: false,
|
||||||
|
|
||||||
// Calendar Notifications
|
// Calendar Notifications
|
||||||
calendarNotificationsEnabled: true,
|
calendarNotificationsEnabled: true,
|
||||||
calendarNotificationSound: true,
|
calendarNotificationSound: true,
|
||||||
@@ -281,6 +287,7 @@ export const useSettingsStore = create<SettingsState>()(
|
|||||||
sendConfirmation: state.sendConfirmation,
|
sendConfirmation: state.sendConfirmation,
|
||||||
defaultReplyMode: state.defaultReplyMode,
|
defaultReplyMode: state.defaultReplyMode,
|
||||||
sessionTimeout: state.sessionTimeout,
|
sessionTimeout: state.sessionTimeout,
|
||||||
|
showTimeInMonthView: state.showTimeInMonthView,
|
||||||
calendarNotificationsEnabled: state.calendarNotificationsEnabled,
|
calendarNotificationsEnabled: state.calendarNotificationsEnabled,
|
||||||
calendarNotificationSound: state.calendarNotificationSound,
|
calendarNotificationSound: state.calendarNotificationSound,
|
||||||
calendarInvitationParsingEnabled: state.calendarInvitationParsingEnabled,
|
calendarInvitationParsingEnabled: state.calendarInvitationParsingEnabled,
|
||||||
|
|||||||
Reference in New Issue
Block a user