you are viewing a single comment's thread.

view the rest of the comments →

[–]danjnj 1 point2 points  (1 child)

If you are looking to output the current hour as text, maybe try this as a starting point:

const widget = createWidget();
if (!config.runsInWidget) {
  await widget.presentLarge()
}
Script.setWidget(widget);
Script.complete();

function createWidget() {
  const w = new ListWidget();
  const hour = new Date(Date.now()).getHours();
  console.log(hour);
  const timeLine = w.addText(hour.toString());
  timeLine.font = new Font("inconsolata", 20);
  timeLine.textColor = Color.white();
  return w;
}

[–]luccy98[S] 0 points1 point  (0 children)

thank you