Skip to content

Instantly share code, notes, and snippets.

Last active September 7, 2023 06:28
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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