OJS Runtime Error

op is not defined

Expand
Magically choose the year!
year_to_show = "2023"
Expand

Total books

Average rating

Books per month
Expand
All books in reverse order
function format_nice_date(date_string) {
  const date = new Date(date_string);
  return new Intl.DateTimeFormat('en-US', { year: 'numeric', month: 'long', day: 'numeric' }).format(date);
}

added_function = aq.addFunction('format_nice_date', format_nice_date)

books_full
  .derive({
    time_actual: d => op.parse_date(d.timestamp),
    pretty_date: d => format_nice_date(d.timestamp),
  })
  .orderby(aq.desc("time_actual"))
  .select({"pretty_date": "Read date", "book_title": "Title", "book_author": "Author", "rating": "Rating"})
  .view()
format_nice_date = ƒ(date_string)
added_function = undefined
OJS Runtime Error (line 194, column 28)

op is not defined

Expand

Here’s a login form. It doesn’t actually do anything. But if you needed to generate a JWT token for making POST requests, you could make it do something.

Expand