|
|
@@ -303,13 +303,11 @@ export default function DayNightDetailPopup(props: {
|
|
|
function diffTimeZone() {
|
|
|
var now = new Date()
|
|
|
if (props.authInfo && props.authInfo.timezone) {
|
|
|
- var t1 = dayjs(now.getTime()).tz(props.authInfo.timezone.id)
|
|
|
+ var t1 = TimeFormatter.tzLocalTime(now.getTime(),props.authInfo.timezone.id)//dayjs(now.getTime()).tz(props.authInfo.timezone.id)
|
|
|
if (now.getHours() == t1.hour() && now.getMinutes() == t1.minute()) {
|
|
|
- console.log('a')
|
|
|
return false
|
|
|
}
|
|
|
else {
|
|
|
- console.log('b')
|
|
|
return true
|
|
|
}
|
|
|
}
|
|
|
@@ -324,7 +322,8 @@ export default function DayNightDetailPopup(props: {
|
|
|
if (isCompleted()) {
|
|
|
var newT;
|
|
|
if (props.authInfo.timezone) {
|
|
|
- newT = dayjs(props.authInfo.night_completed.sunset_ts).tz(props.authInfo.timezone.id).format('M月D日 HH:mm')
|
|
|
+ newT = TimeFormatter.tzTimeFormateLocalTime(props.authInfo.night_completed.sunset_ts, props.authInfo.timezone.id, 'M月D日 HH:mm')
|
|
|
+ //dayjs(props.authInfo.night_completed.sunset_ts).tz(props.authInfo.timezone.id).format('M月D日 HH:mm')
|
|
|
}
|
|
|
else {
|
|
|
newT = dayjs(props.authInfo.night_completed.sunset_ts).format('M月D日 HH:mm')
|
|
|
@@ -343,7 +342,9 @@ export default function DayNightDetailPopup(props: {
|
|
|
)
|
|
|
var newT2;
|
|
|
if (props.authInfo.timezone) {
|
|
|
- newT2 = dayjs(props.authInfo.night_completed.sunrise_ts).tz(props.authInfo.timezone.id).format('M月D日 HH:mm')
|
|
|
+ newT2 = TimeFormatter.tzTimeFormateLocalTime(props.authInfo.night_completed.sunrise_ts, props.authInfo.timezone.id, 'M月D日 HH:mm')
|
|
|
+
|
|
|
+ //dayjs(props.authInfo.night_completed.sunrise_ts).tz(props.authInfo.timezone.id).format('M月D日 HH:mm')
|
|
|
}
|
|
|
else {
|
|
|
newT2 = dayjs(props.authInfo.night_completed.sunrise_ts).format('M月D日 HH:mm')
|
|
|
@@ -364,8 +365,10 @@ export default function DayNightDetailPopup(props: {
|
|
|
|
|
|
var list = nightDurationDesc()
|
|
|
if (diffTimeZone() && global.nightObj) {
|
|
|
- list[0] = dayjs(global.nightObj.sunset.timestamp).tz(props.authInfo.timezone.id).format('M月D日')
|
|
|
- list[1] = dayjs(global.nightObj.sunrise.timestamp).tz(props.authInfo.timezone.id).format('M月D日')
|
|
|
+ list[0] = TimeFormatter.tzTimeFormateLocalTime(global.nightObj.sunset.timestamp, props.authInfo.timezone.id, 'M月D日')
|
|
|
+ list[1] = TimeFormatter.tzTimeFormateLocalTime(global.nightObj.sunrise.timestamp, props.authInfo.timezone.id, 'M月D日')
|
|
|
+ // list[0] = dayjs(global.nightObj.sunset.timestamp).tz(props.authInfo.timezone.id).format('M月D日')
|
|
|
+ // list[1] = dayjs(global.nightObj.sunrise.timestamp).tz(props.authInfo.timezone.id).format('M月D日')
|
|
|
|
|
|
}
|
|
|
timelineItems.push(
|
|
|
@@ -395,7 +398,8 @@ export default function DayNightDetailPopup(props: {
|
|
|
if (isCompleted()) {
|
|
|
var newT;
|
|
|
if (props.authInfo.timezone) {
|
|
|
- newT = dayjs(props.authInfo.day_completed.sunrise_ts).tz(props.authInfo.timezone.id).format('M月D日 HH:mm')
|
|
|
+ newT = TimeFormatter.tzTimeFormateLocalTime(props.authInfo.day_completed.sunrise_ts, props.authInfo.timezone.id, 'M月D日 HH:mm')
|
|
|
+ // newT = dayjs(props.authInfo.day_completed.sunrise_ts).tz(props.authInfo.timezone.id).format('M月D日 HH:mm')
|
|
|
}
|
|
|
else {
|
|
|
newT = dayjs(props.authInfo.day_completed.sunrise_ts).format('M月D日 HH:mm')
|
|
|
@@ -412,7 +416,8 @@ export default function DayNightDetailPopup(props: {
|
|
|
)
|
|
|
var newT2;
|
|
|
if (props.authInfo.timezone) {
|
|
|
- newT2 = dayjs(props.authInfo.day_completed.sunset_ts).tz(props.authInfo.timezone.id).format('M月D日 HH:mm')
|
|
|
+ newT2 = TimeFormatter.tzTimeFormateLocalTime(props.authInfo.day_completed.sunset_ts, props.authInfo.timezone.id, 'M月D日 HH:mm')
|
|
|
+ // newT2 = dayjs(props.authInfo.day_completed.sunset_ts).tz(props.authInfo.timezone.id).format('M月D日 HH:mm')
|
|
|
}
|
|
|
else {
|
|
|
newT2 = dayjs(props.authInfo.day_completed.sunset_ts).format('M月D日 HH:mm')
|
|
|
@@ -430,8 +435,10 @@ export default function DayNightDetailPopup(props: {
|
|
|
else {
|
|
|
var list = dayDurationDesc()
|
|
|
if (diffTimeZone() && global.dayObj) {
|
|
|
- list[0] = dayjs(global.dayObj.sunrise.timestamp).tz(props.authInfo.timezone.id).format('M月D日')
|
|
|
- list[1] = dayjs(global.dayObj.sunset.timestamp).tz(props.authInfo.timezone.id).format('M月D日')
|
|
|
+ list[0] = TimeFormatter.tzTimeFormateLocalTime(global.dayObj.sunrise.timestamp, props.authInfo.timezone.id, 'M月D日')
|
|
|
+ list[1] = TimeFormatter.tzTimeFormateLocalTime(global.dayObj.sunset.timestamp, props.authInfo.timezone.id, 'M月D日')
|
|
|
+ // list[0] = dayjs(global.dayObj.sunrise.timestamp).tz(props.authInfo.timezone.id).format('M月D日')
|
|
|
+ // list[1] = dayjs(global.dayObj.sunset.timestamp).tz(props.authInfo.timezone.id).format('M月D日')
|
|
|
|
|
|
}
|
|
|
timelineItems.push(
|
|
|
@@ -480,7 +487,7 @@ export default function DayNightDetailPopup(props: {
|
|
|
|
|
|
function getTZOffset() {
|
|
|
var current1 = dayjs()
|
|
|
- var current = dayjs().tz(props.authInfo.timezone.id)
|
|
|
+ var current = TimeFormatter.tzLocalTime(new Date().getTime(),props.authInfo.timezone.id)//dayjs().tz(props.authInfo.timezone.id)
|
|
|
var offset = current.date() * 24 * 60 + current.hour() * 60 + current.minute() - current1.date() * 24 * 60 - current1.hour() * 60 - current1.minute()
|
|
|
|
|
|
var hour = Math.floor(Math.abs(offset) / 60)
|
|
|
@@ -505,7 +512,7 @@ export default function DayNightDetailPopup(props: {
|
|
|
|
|
|
function diffentTZDesc() {
|
|
|
var current1 = dayjs()
|
|
|
- var current = dayjs().tz(props.authInfo.timezone.id)
|
|
|
+ var current = TimeFormatter.tzLocalTime(new Date().getTime(),props.authInfo.timezone.id)//dayjs().tz(props.authInfo.timezone.id)
|
|
|
var offset = current.date() * 24 * 60 + current.hour() * 60 + current.minute() - current1.date() * 24 * 60 - current1.hour() * 60 - current1.minute()
|
|
|
var hour = Math.floor(Math.abs(offset) / 60)
|
|
|
var minute = Math.abs(offset) % 60
|