Alexander’s books
All of Alexander’s books
d3 = require("d3")
results = await fetch("https://api.andrewheiss.com/books?person=" + person_id + "&start_date=2025-01-01&end_date=2025-12-31")
.then(response => response.json())
.then(data => ({
...data,
data: data.data.map(d => ({
...d,
timestamp_local: new Date(d.timestamp_local_as_utc),
}))
}));
table_settings = {
return {
sort: "timestamp_local",
reverse: true,
rows: 32.5,
layout: "auto",
columns: [
"timestamp_local",
"title",
"author_name"
],
header: {
timestamp_local: "Date",
title: "Title",
author_name: "Author"
},
format: {
// Format as nice date + remove 2 spaces for things like "January 2" + remove leading 0 for hours
timestamp_local: d => d3.utcFormat("%A, %B %e, %Y at %I:%M %p")(d).replace(/ +/g, ' ').replace(/ 0(\d):/, ' $1:')
}
}
}