05-26-2021 13:50
05-26-2021 13:50
I'm trying to create a clock face with an arc that shows sunrise and sunset times. When trying to calculate the angles, I have the following code to determine whether daylight savings is in effect:
Date.prototype.stdTimezoneOffset = function () {
var jan = new Date(this.getFullYear(), 0, 1);
var jul = new Date(this.getFullYear(), 6, 1);
console.log(jan + " : " + jul);
console.log(jan.getTimezoneOffset() + " : " + jul.getTimezoneOffset());
return Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset());
}
[3:44:47 PM] App: Fri Jan 01 2021 00:00:00 GMT-05:00 : Thu Jul 01 2021 00:00:00 GMT-05:00 (app/index.js:150,1)
[3:44:47 PM] App: 300 : 300 (app/index.js:150,1)
05-26-2021 14:01 - edited 05-26-2021 14:01
05-26-2021 14:01 - edited 05-26-2021 14:01
Hi @AidanBlack I've moved your post out of hardware support and into clock/app development support