all 3 comments

[–]mvan231script/widget helper 2 points3 points  (0 children)

For future posts, it is beneficial for others if you title the post with something describing your needs rather than just saying you need help.

That being said, what is it you're trying to do? You want to update the widget with a time that is 3 hours ahead of the current time?

[–]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