Skip to content

Instantly share code, notes, and snippets.

Last active Nov 4, 2020
What would you like to do?
Countdown to Apple's "One More Thing" event on November 10th, 2020
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: deep-purple; icon-glyph: apple-alt;
const TITLE = "One More Thing"
const DATE = "2020-11-10T17:00:00Z"
const IMG_URL = ""
let widget = await createWidget()
if (config.runsInWidget) {
} else {
await widget.presentMedium()
async function createWidget() {
let eventDate = createEventDate()
let bgImg = await loadBgImage()
let widget = new ListWidget()
widget.backgroundImage = bgImg
let wtitle = widget.addText(TITLE)
wtitle.font = Font.boldSystemFont(20)
wtitle.textColor = Color.white()
let wdate = widget.addDate(eventDate)
wdate.font = Font.mediumSystemFont(18)
wdate.textColor = Color.white()
return widget
function createEventDate() {
let dateFormatter = new DateFormatter()
dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZ"
async function loadBgImage() {
let req = new Request(IMG_URL)
return await req.loadImage()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment