Skip to content

Commit fd1173a

Browse files
committed
change logbook name in dropdown menu from date to title
1 parent 0ca562d commit fd1173a

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

frontend/src/components/Modals/LogbookSelectionModal/LogbookSelectionModal.jsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export const LogbookSelectionModal = () => {
3535
}
3636
}, [openSelection, session?.access_token]);
3737

38-
const formatLogbookType = (type, created) => {
38+
const formatLogbookType = (type, title) => {
3939
if (!type) return "Untitled Logbook";
4040

4141
const formattedType = type
@@ -44,11 +44,7 @@ export const LogbookSelectionModal = () => {
4444
.join(" ")
4545
.replace("Logs", "");
4646

47-
const month = new Date(created).toLocaleString("default", {
48-
month: "short",
49-
});
50-
51-
return `${formattedType} - ${month}.`;
47+
return `${formattedType} - ${title}`;
5248
};
5349

5450
return (
@@ -88,7 +84,7 @@ export const LogbookSelectionModal = () => {
8884
{selectedLogbook
8985
? formatLogbookType(
9086
selectedLogbook.type,
91-
selectedLogbook.created
87+
selectedLogbook.title
9288
)
9389
: "Select"}
9490
<span className="logbook-selector__icon">
@@ -106,7 +102,7 @@ export const LogbookSelectionModal = () => {
106102
setDropdownOpen(false);
107103
}}
108104
>
109-
{formatLogbookType(logbook.type, logbook.created)}
105+
{formatLogbookType(logbook.type, logbook.title)}
110106
</div>
111107
))}
112108
</div>

0 commit comments

Comments
 (0)