using Toybox.Position as Position;
using Toybox.Time as Time;
var sc = new SunCalc();
var info = Position.getInfo();
if (info != null && info.accuracy != Position.QUALITY_NOT_AVAILABLE) {
var loc = info.position.toRadians();
var sunrise_moment = sc.calculate(Time.now.value(), loc[0], loc[1], SUNRISE);
var sunset_moment = sc.calculate(Time.now.value(), loc[0], loc[1], SUNSET);
}
var sunrise_moment = sc.calculate(Time.now.value(), loc[0], loc[1], SUNRISE);
var sunset_moment = sc.calculate(Time.now.value(), loc[0], loc[1], SUNSET);
}
var sunrise_moment = sc.calculate(new Time.Moment(Time.now().value()), loc[0], loc[1], SUNRISE);
var sunset_moment = sc.calculate(new Time.Moment(Time.now().value()), loc[0], loc[1], SUNSET);
var now = Time.now();
var sunrise_moment = sc.calculate(now, loc[0], loc[1], SUNRISE);
var sunset_moment = sc.calculate(now, loc[0], loc[1], SUNSET);
}
But a watchface cannot access position no?