|
|
@@ -44,8 +44,8 @@ export default function DayNightRing(props: {
|
|
|
realRingBig.color = ColorType.day
|
|
|
var duration = (authInfo.day_completed.sunset_ts - authInfo.day_completed.sunrise_ts) / 1000
|
|
|
var time = authInfo.day_completed.sunrise
|
|
|
- time = time.substring(time.length-8, time.length)
|
|
|
- var start = new Date('2024-01-01T'+time)
|
|
|
+ time = time.substring(time.length - 8, time.length)
|
|
|
+ var start = new Date('2024-01-01T' + time)
|
|
|
realRingBig.startArc = (start.getHours() * 3600 + start.getMinutes() * 60) / (24 * 3600) * 2 * Math.PI - Math.PI / 2.0;
|
|
|
realRingBig.durationArc = (duration) / (24 * 3600) * 2 * Math.PI;
|
|
|
// if (!realRingBig.startArc){
|
|
|
@@ -66,8 +66,8 @@ export default function DayNightRing(props: {
|
|
|
|
|
|
var duration = sunSet - sunRise
|
|
|
|
|
|
- if (global.dayObj){
|
|
|
- duration = (global.dayObj.sunset.timestamp-global.dayObj.sunrise.timestamp)/60000
|
|
|
+ if (global.dayObj) {
|
|
|
+ duration = (global.dayObj.sunset.timestamp - global.dayObj.sunrise.timestamp) / 60000
|
|
|
}
|
|
|
|
|
|
realRingBig.startArc = (sunRise * 60) / (24 * 3600) * 2 * Math.PI - Math.PI / 2.0;
|
|
|
@@ -75,7 +75,7 @@ export default function DayNightRing(props: {
|
|
|
|
|
|
var currentDot = getDot(null, false)
|
|
|
|
|
|
- if (authInfo && authInfo.timezone.id) {
|
|
|
+ if (authInfo && authInfo.timezone && authInfo.timezone.id) {
|
|
|
var current1 = dayjs()
|
|
|
var current = dayjs().tz(authInfo.timezone.id)
|
|
|
var offset = current.day() * 24 * 60 + current.hour() * 60 + current.minute() - current1.day() * 24 * 60 - current1.hour() * 60 - current1.minute()
|
|
|
@@ -152,9 +152,9 @@ export default function DayNightRing(props: {
|
|
|
realRingBig.color = ColorType.night
|
|
|
var duration = (authInfo.night_completed.sunrise_ts - authInfo.night_completed.sunset_ts) / 1000
|
|
|
var time = authInfo.night_completed.sunset
|
|
|
- time = time.substring(time.length-8, time.length)
|
|
|
- var start = new Date('2024-01-01T'+time)
|
|
|
-
|
|
|
+ time = time.substring(time.length - 8, time.length)
|
|
|
+ var start = new Date('2024-01-01T' + time)
|
|
|
+
|
|
|
realRingBig.startArc = (start.getHours() * 3600 + start.getMinutes() * 60) / (24 * 3600) * 2 * Math.PI - Math.PI / 2.0;
|
|
|
realRingBig.durationArc = (duration) / (24 * 3600) * 2 * Math.PI;
|
|
|
//已结束未更新暂停时,显示current_dot
|
|
|
@@ -177,8 +177,8 @@ export default function DayNightRing(props: {
|
|
|
}
|
|
|
var duration = sunRise - sunSet
|
|
|
|
|
|
- if (global.nightObj){
|
|
|
- duration = (global.nightObj.sunrise.timestamp-global.nightObj.sunset.timestamp)/60000
|
|
|
+ if (global.nightObj) {
|
|
|
+ duration = (global.nightObj.sunrise.timestamp - global.nightObj.sunset.timestamp) / 60000
|
|
|
// if (global.nightObj.sunrise.timestamp-new Date().getTime()>48*3600*1000){
|
|
|
// duration = 24*60
|
|
|
// }
|