Skip to content

Instantly share code, notes, and snippets.

@typeoneerror
Last active September 13, 2023 00:59
Show Gist options
  • Save typeoneerror/04ca6e4962428c1b09431e00d0eb61d2 to your computer and use it in GitHub Desktop.
Save typeoneerror/04ca6e4962428c1b09431e00d0eb61d2 to your computer and use it in GitHub Desktop.
lets(
/* Store unfinished tasks */
tasks, prop("Tasks").filter(current.prop("Status") != "Done"),
/* Sort by timestamp of task and store with id */
task,
tasks
.map(formatDate(current.prop("Date"), "X") + "-" + current.id())
.sort()
.first(),
/* Explode stored id and find the task with that id */
tasks
.find(
let(
taskId,
task.split("-").last(),
current.id() == taskId
)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment