Skip to content

Commit 0aaeb7b

Browse files
committed
feat: clarify note date hover details
1 parent 64ba60e commit 0aaeb7b

8 files changed

Lines changed: 51 additions & 18 deletions

File tree

‎EdgeMark/Resources/Locales/de.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@
103103

104104
"editor.copyNote": "Notiz kopieren",
105105
"editor.deleteNote": "Notiz löschen",
106-
"editor.modifiedAt": "Geändert am {0}",
107-
"editor.createdAt": "Erstellt am {0}",
106+
"editor.modifiedAt": "Geändert am {0} um {1}",
107+
"editor.createdAt": "Erstellt am {0} um {1}",
108108
"editor.readOnly": "(schreibgeschützt)",
109109
"editor.restoreNote": "Notiz wiederherstellen",
110110

‎EdgeMark/Resources/Locales/en.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@
103103

104104
"editor.copyNote": "Copy Note",
105105
"editor.deleteNote": "Delete Note",
106-
"editor.modifiedAt": "Modified at {0}",
107-
"editor.createdAt": "Created at {0}",
106+
"editor.modifiedAt": "Modified on {0} at {1}",
107+
"editor.createdAt": "Created on {0} at {1}",
108108
"editor.readOnly": "(read-only)",
109109
"editor.restoreNote": "Restore Note",
110110

‎EdgeMark/Resources/Locales/es.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@
103103

104104
"editor.copyNote": "Copiar nota",
105105
"editor.deleteNote": "Eliminar nota",
106-
"editor.modifiedAt": "Modificada el {0}",
107-
"editor.createdAt": "Creada el {0}",
106+
"editor.modifiedAt": "Modificada el {0} a las {1}",
107+
"editor.createdAt": "Creada el {0} a las {1}",
108108
"editor.readOnly": "(solo lectura)",
109109
"editor.restoreNote": "Restaurar nota",
110110

‎EdgeMark/Resources/Locales/hi.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@
103103

104104
"editor.copyNote": "नोट कॉपी करें",
105105
"editor.deleteNote": "नोट हटाएं",
106-
"editor.modifiedAt": "{0} पर बदला गया",
107-
"editor.createdAt": "{0} पर बनाया गया",
106+
"editor.modifiedAt": "{0} को {1} बजे बदला गया",
107+
"editor.createdAt": "{0} को {1} बजे बनाया गया",
108108
"editor.readOnly": "(केवल पढ़ने के लिए)",
109109
"editor.restoreNote": "नोट वापस लाएं",
110110

‎EdgeMark/Resources/Locales/zh-Hans.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@
103103

104104
"editor.copyNote": "复制笔记",
105105
"editor.deleteNote": "删除笔记",
106-
"editor.modifiedAt": "修改于 {0}",
107-
"editor.createdAt": "创建于 {0}",
106+
"editor.modifiedAt": "修改于 {0} {1}",
107+
"editor.createdAt": "创建于 {0} {1}",
108108
"editor.readOnly": "(只读)",
109109
"editor.restoreNote": "恢复笔记",
110110

‎EdgeMark/UI/Components/DateFormatting.swift‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,29 @@ extension Date {
1616
.minute(.twoDigits),
1717
)
1818
}
19+
20+
var homeDateFormat: String {
21+
formatted(
22+
Date.FormatStyle(
23+
date: .omitted,
24+
time: .omitted,
25+
locale: Locale(identifier: L10n.shared.resolvedLocaleIdentifier),
26+
)
27+
.year(.defaultDigits)
28+
.month(.abbreviated)
29+
.day(.twoDigits),
30+
)
31+
}
32+
33+
var homeTimeFormat: String {
34+
formatted(
35+
Date.FormatStyle(
36+
date: .omitted,
37+
time: .omitted,
38+
locale: Locale(identifier: L10n.shared.resolvedLocaleIdentifier),
39+
)
40+
.hour(.twoDigits(amPM: .abbreviated))
41+
.minute(.twoDigits),
42+
)
43+
}
1944
}

‎EdgeMark/UI/Components/NoteHeaderTitle.swift‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ struct NoteHeaderTitle: View {
77

88
let title: String
99
let path: String
10-
let modifiedAt: String
11-
let createdAt: String
10+
let modifiedAt: Date
11+
let createdAt: Date
1212
@Binding var text: String
1313
var isFocused: FocusState<Bool>.Binding
1414
let isEditing: Bool
@@ -56,8 +56,8 @@ struct NoteHeaderTitle: View {
5656
guard !appSettings.showNoteDatesInHeader else { return path }
5757
return [
5858
path,
59-
L10n.shared.t("editor.modifiedAt", modifiedAt),
60-
L10n.shared.t("editor.createdAt", createdAt),
59+
L10n.shared.t("editor.modifiedAt", modifiedAt.homeDateFormat, modifiedAt.homeTimeFormat),
60+
L10n.shared.t("editor.createdAt", createdAt.homeDateFormat, createdAt.homeTimeFormat),
6161
].joined(separator: "\n")
6262
}
6363
}

‎EdgeMark/UI/EditorScreen.swift‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ struct EditorScreen: View {
9797
NoteHeaderTitle(
9898
title: note.title.isEmpty ? l10n["common.untitled"] : note.title,
9999
path: note.displayPath,
100-
modifiedAt: note.modifiedAt.homeDisplayFormat,
101-
createdAt: note.createdAt.homeDisplayFormat,
100+
modifiedAt: note.modifiedAt,
101+
createdAt: note.createdAt,
102102
text: Binding(
103103
get: {
104104
noteRename.renamingNoteID == note.id
@@ -154,13 +154,21 @@ struct EditorScreen: View {
154154
DateLabelView(
155155
systemName: "clock",
156156
date: note.modifiedAt.homeDisplayFormat,
157-
tooltip: L10n.shared.t("editor.modifiedAt", note.modifiedAt.homeDisplayFormat),
157+
tooltip: L10n.shared.t(
158+
"editor.modifiedAt",
159+
note.modifiedAt.homeDateFormat,
160+
note.modifiedAt.homeTimeFormat,
161+
),
158162
)
159163

160164
DateLabelView(
161165
systemName: "calendar",
162166
date: note.createdAt.homeDisplayFormat,
163-
tooltip: L10n.shared.t("editor.createdAt", note.createdAt.homeDisplayFormat),
167+
tooltip: L10n.shared.t(
168+
"editor.createdAt",
169+
note.createdAt.homeDateFormat,
170+
note.createdAt.homeTimeFormat,
171+
),
164172
)
165173
}
166174
}

0 commit comments

Comments
 (0)