generated from cms/tibi-docs
This commit is contained in:
@@ -2,8 +2,9 @@
|
||||
export let persons: Page[]
|
||||
let boxes = persons.map((p) => p.personPreview.name)
|
||||
const sortByFirstName = (a, b) => {
|
||||
const nameA = a?.name?.split(" ")[0] // Extracts the first name from "First Last"
|
||||
const nameB = b?.name?.split(" ")[0]
|
||||
const nameA = a?.split(" ")[0] // Extracts the first name from "First Last"
|
||||
const nameB = b?.split(" ")[0]
|
||||
console.log("nameA", nameA, "nameB", nameB, "comp", nameA?.localeCompare(nameB))
|
||||
return nameA?.localeCompare(nameB)
|
||||
}
|
||||
boxes = boxes.sort(sortByFirstName)
|
||||
|
||||
Reference in New Issue
Block a user