Skip to content

Instantly share code, notes, and snippets.

@typeoneerror
Created September 20, 2023 16:09
Show Gist options
  • Save typeoneerror/149c4e5093d9a91526c37371a40945c5 to your computer and use it in GitHub Desktop.
Save typeoneerror/149c4e5093d9a91526c37371a40945c5 to your computer and use it in GitHub Desktop.
Next Action in a Project
lets(
/* Store unfinished actions */
actions, prop("Actions").filter(!["Done", "Archive"].includes(current.prop("Status"))),
/* Sort by timestamp of task and store with id */
actionId,
actions
.map(formatDate(current.prop("Date"), "X") + "-" + current.id())
.sort()
.first()
.split("-")
.last(),
/* Explode stored id and find the task with that id */
nextAction,
actions.find(current.id() == actionId),
/* Final line determines the display */
nextAction + " " + nextAction.prop("Date")
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment