leon 1 年之前
父节点
当前提交
31c85e4add

+ 0 - 82
src/features/trackTimeDuration/components/AllDayRings.tsx

@@ -36,7 +36,6 @@ export default function AllDayRings(props: { schedule: any }) {
     const [showRing, setShowRing] = useState(false)
     const user = useSelector((state: any) => state.user);
     const ring = useSelector((state: any) => state.ring);
-    const day = useSelector((state: any) => state.day);
     const [schedule] = useState(props.schedule)
     const { t } = useTranslation()
 
@@ -259,87 +258,6 @@ export default function AllDayRings(props: { schedule: any }) {
             canvasId={'day_night_card_big_day_ring111'}
             authInfo={authInfo}
         />
-        // var common = getCommon(null, true)
-        // common.radius = thirdRingRadius;
-        // common.lineWidth = ringWidth;
-        // var bgRing = getBgRing()
-
-        // const realRingBig: RealRing = {
-        //     color: ColorType.day + '66',
-        //     startArc: 0,
-        //     durationArc: 2
-        // }
-
-        // var now = new Date().getTime()
-        
-
-        // if (authInfo && authInfo.day_completed && now > authInfo.day_completed.sunset_ts) {
-        //     realRingBig.color = ColorType.day
-        //     var duration = (authInfo.day_completed.sunset_ts - authInfo.day_completed.sunrise_ts) / 1000
-        //     // var start = new Date(authInfo.day_completed.sunrise_ts)
-        //     // var start = new Date(authInfo.night_completed.sunset_ts)
-        //     var newT = TimeFormatter.transferTimestamp(authInfo.day_completed.sunrise_ts,authInfo.timezone)
-        //     var start = new Date(newT)
-        //     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;
-        //     return <Rings common={common} bgRing={bgRing} targetRing={realRingBig} canvasId={'ddddsss_day1111' + 'index_day'} />
-
-        // }
-
-        // if (authInfo && authInfo.timezone) {
-        //     now = TimeFormatter.transferTimestamp(now, authInfo.timezone)
-        // }
-
-
-        // var sunRise = 6 * 60
-        // var sunSet = 18 * 60
-
-        // var sunRiseObj = day.dayRingSunrise
-        // var sunSetObj = day.dayRingSunset
-        // sunRise = parseInt(sunRiseObj.split(':')[0]) * 60 + parseInt(sunRiseObj.split(':')[1])
-        // sunSet = parseInt(sunSetObj.split(':')[0]) * 60 + parseInt(sunSetObj.split(':')[1])
-
-
-        // var duration = sunSet - sunRise
-
-        // realRingBig.startArc = (sunRise * 60) / (24 * 3600) * 2 * Math.PI - Math.PI / 2.0;
-        // realRingBig.durationArc = (duration * 60) / (24 * 3600) * 2 * Math.PI;
-
-        // var currentDot = getDot(null, false)
-        // if (authInfo && authInfo.timezone){
-        //     currentDot.offset = TimeFormatter.timeZoneOffset(authInfo.timezone)
-        // }
-        // var date = new Date(now)
-        // var minutes = date.getHours() * 60 + date.getMinutes()
-        // if (minutes < sunRise) {
-        //     minutes += 1440
-        // }
-
-        // currentDot.color = ColorType.day
-
-        // var t = date.getHours() * 60 + date.getMinutes()
-        // var duration2 = t - sunRise
-        // if (duration2 < 0) {
-        //     duration2 += 24 * 60
-        // }
-        // var realRing: RealRing = {
-        //     color: ColorType.day,
-        //     startArc: (sunRise * 60) / (24 * 3600) * 2 * Math.PI - Math.PI / 2.0,
-        //     durationArc: (duration2 * 60) / (24 * 3600) * 2 * Math.PI
-        // }
-        // if (day.dayRingDate) {
-        //     if (new Date(day.dayRingDate).getDate() != new Date().getDate()) {
-        //         realRing = null;
-        //     }
-        // }
-
-        // if (!user.isLogin) {
-        //     currentDot = null
-        //     realRing = null
-        // }
-
-        // return <Rings common={common} bgRing={bgRing} targetRing={realRingBig} realRing={duration2 <= duration ? realRing : null} currentDot={currentDot} canvasId={'day111_day2'} />
-    
     }
 
 

+ 0 - 77
src/features/trackTimeDuration/components/AllRings.tsx

@@ -207,83 +207,6 @@ export default function AllRings(props: { data?: any, time?: any }) {
             canvasId={'day_night_card_big_night_ring111'}
             authInfo={authInfo}
         />
-        // var common = getCommon(null, true)
-        // common.radius = thirdRingRadius;
-        // common.lineWidth = ringWidth;
-        // var bgRing = getBgRing()
-
-        // let realRingBig: RealRing = {
-        //     color: ColorType.night + '66',
-        //     startArc: 0,
-        //     durationArc: 2
-        // }
-
-        // var now = new Date().getTime()
-        // if (authInfo && authInfo.timezone) {
-        //     now = TimeFormatter.transferTimestamp(now, authInfo.timezone)
-        // }
-
-
-        // if (authInfo && authInfo.night_completed && now > authInfo.night_completed.sunrise_ts) {
-        //     realRingBig.color = ColorType.night
-        //     var duration = (authInfo.night_completed.sunrise_ts - authInfo.night_completed.sunset_ts) / 1000
-        //     // var start = new Date(authInfo.night_completed.sunset_ts)
-        //     var newT = TimeFormatter.transferTimestamp(authInfo.night_completed.sunset_ts, authInfo.timezone)
-        //     var start = new Date(newT)
-        //     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;
-        //     return <Rings common={common} bgRing={bgRing} targetRing={realRingBig} canvasId={'allday' + 'index_day'} />
-
-        // }
-
-        // var sunRise = 24 * 60 + 6 * 60
-        // var sunSet = 18 * 60
-
-        // var sunRiseObj = nightStore.nightRingSunrise
-        // var sunSetObj = nightStore.nightRingSunset
-        // sunRise = 24 * 60 + parseInt(sunRiseObj.split(':')[0]) * 60 + parseInt(sunRiseObj.split(':')[1])
-        // sunSet = parseInt(sunSetObj.split(':')[0]) * 60 + parseInt(sunSetObj.split(':')[1])
-        // if (sunSetObj.indexOf('PM') != -1) {
-        //     sunSet += 12 * 60
-        // }
-        // // }
-        // var duration = sunRise - sunSet
-        // realRingBig.startArc = (sunSet * 60) / (24 * 3600) * 2 * Math.PI - Math.PI / 2.0;
-        // realRingBig.durationArc = (duration * 60) / (24 * 3600) * 2 * Math.PI;
-
-        // var currentDot = getDot(null, false)
-        // if (authInfo && authInfo.timezone) {
-        //     currentDot.offset = TimeFormatter.timeZoneOffset(authInfo.timezone)
-        // }
-        // currentDot.color = ColorType.night
-
-        // var date = new Date(now)
-        // var t = date.getHours() * 60 + date.getMinutes()
-        // var duration2 = t - sunSet
-        // if (duration2 < 0) {
-        //     duration2 += 24 * 60
-        // }
-        // let realRing: RealRing = {
-        //     color: ColorType.night,
-        //     startArc: (sunSet * 60) / (24 * 3600) * 2 * Math.PI - Math.PI / 2.0,
-        //     durationArc: (duration2 * 60) / (24 * 3600) * 2 * Math.PI
-        // }
-
-        // if (nightStore.nightRingDate) {
-        //     if (new Date(nightStore.nightRingDate).getDate() == date.getDate() && date.getHours() < 12) {
-
-        //         realRing = null;
-        //     }
-        // }
-
-        // if (!user.isLogin) {
-        //     currentDot = null;
-        //     realRing = null;
-        // }
-
-
-        // return <Rings common={common} bgRing={bgRing} targetRing={realRingBig} realRing={duration2 > duration ? null : realRing} currentDot={currentDot} canvasId={'all_night' + 'index_day'} />
-
     }
 
     function rings() {

+ 0 - 171
src/features/trackTimeDuration/components/DayNightCard.tsx

@@ -789,93 +789,7 @@ export default function DayNightCard(props: { isNight: boolean, count: number })
             isThirdRing={false}
             canvasId={'day_night_card_night_ring'}
             authInfo={authInfo}
-            currentStatus={currentStatus()}
         />
-        // var common = getCommon(null, true)
-        // common.radius = bigRingRadius;
-        // common.lineWidth = ringWidth;
-        // var bgRing = getBgRing()
-
-        // let realRingBig: RealRing = {
-        //     color: ColorType.night + '66',
-        //     startArc: 0,
-        //     durationArc: 2
-        // }
-
-
-        // var now1 = new Date().getTime()
-        // if (authInfo && authInfo.timezone) {
-        //     now1 = TimeFormatter.transferTimestamp(now1, authInfo.timezone)
-        // }
-
-        // if (authInfo && authInfo.night_completed && new Date().getTime() > authInfo.night_completed.sunrise_ts) {
-        //     realRingBig.color = ColorType.night
-        //     var duration = (authInfo.night_completed.sunrise_ts - authInfo.night_completed.sunset_ts) / 1000
-        //     // var start = new Date(authInfo.night_completed.sunset_ts)
-        //     var newT = TimeFormatter.transferTimestamp(authInfo.night_completed.sunset_ts, authInfo.timezone)
-        //     var start = new Date(newT)
-        //     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;
-
-        //     var currentDot = getDot(null, false)
-        //     currentDot.color = ColorType.night
-        //     currentDot.offset = (authInfo && authInfo.timezone) ? TimeFormatter.timeZoneOffset(authInfo.timezone) : 0;
-        //     //已结束未更新暂停时,显示current_dot
-        //     if (currentStatus() == t('feature.day_night.update_paused')){
-        //         currentDot = null
-        //     }
-
-        //     return <Rings common={common} bgRing={bgRing} targetRing={realRingBig} currentDot={currentDot} canvasId={'ddddsss' + 'index_day'} />
-
-        // }
-
-        // var sunRise = 24 * 60 + 6 * 60
-        // var sunSet = 18 * 60
-
-        // var sunRiseObj = user.isLogin ? nightStore.nightRingSunrise : '06:00:00'
-        // var sunSetObj = user.isLogin ? nightStore.nightRingSunset : '18:00:00'
-        // sunRise = 24 * 60 + parseInt(sunRiseObj.split(':')[0]) * 60 + parseInt(sunRiseObj.split(':')[1])
-        // sunSet = parseInt(sunSetObj.split(':')[0]) * 60 + parseInt(sunSetObj.split(':')[1])
-        // if (sunSetObj.indexOf('PM') != -1) {
-        //     sunSet += 12 * 60
-        // }
-        // // }
-        // var duration = sunRise - sunSet
-        // realRingBig.startArc = (sunSet * 60) / (24 * 3600) * 2 * Math.PI - Math.PI / 2.0;
-        // realRingBig.durationArc = (duration * 60) / (24 * 3600) * 2 * Math.PI;
-
-        // var currentDot = getDot(null, false)
-        // currentDot.color = ColorType.night
-        // currentDot.offset = (authInfo && authInfo.timezone) ? TimeFormatter.timeZoneOffset(authInfo.timezone) : 0
-
-        // var now = new Date()
-        // now = localNow(now)
-
-        // var t1 = now.getHours() * 60 + now.getMinutes()
-        // var duration2 = t1 - sunSet
-        // if (duration2 < 0) {
-        //     duration2 += 24 * 60
-        // }
-        // let realRing: RealRing = {
-        //     color: ColorType.night,
-        //     startArc: (sunSet * 60) / (24 * 3600) * 2 * Math.PI - Math.PI / 2.0,
-        //     durationArc: (duration2 * 60) / (24 * 3600) * 2 * Math.PI
-        // }
-
-        // if (nightStore.nightRingDate) {
-        //     if (new Date(nightStore.nightRingDate).getDate() == now.getDate() && now.getHours() < 12) {
-        //         realRing = null;
-        //     }
-        // }
-
-        // // if (!user.isLogin) {
-        // //     currentDot = null;
-        // //     realRing = null;
-        // // }
-
-
-        // return <Rings common={common} bgRing={bgRing} targetRing={realRingBig} realRing={duration2 > duration ? null : realRing} currentDot={currentDot} canvasId={'dddd' + 'index_day'} />
-
     }
 
     function localNow(now: Date) {
@@ -886,97 +800,12 @@ export default function DayNightCard(props: { isNight: boolean, count: number })
     }
 
     function dayRing() {
-
         return <DayNightRing
             isNight={false}
             isThirdRing={false}
             canvasId={'day_night_card_big_day'}
             authInfo={authInfo}
         />
-
-        // var common = getCommon(null, true)
-        // common.radius = bigRingRadius;
-        // common.lineWidth = ringWidth;
-        // var bgRing = getBgRing()
-
-        // const realRingBig: RealRing = {
-        //     color: ColorType.day + '66',
-        //     startArc: 0,
-        //     durationArc: 2
-        // }
-
-        // var now1 = new Date().getTime()
-
-
-
-        // if (authInfo && authInfo.day_completed && now1 > authInfo.day_completed.sunset_ts) {
-        //     realRingBig.color = ColorType.day
-        //     var duration = (authInfo.day_completed.sunset_ts - authInfo.day_completed.sunrise_ts) / 1000
-        //     // var start = new Date(authInfo.day_completed.sunrise_ts)
-        //     // var start = new Date(authInfo.night_completed.sunset_ts)
-        //     var newT = TimeFormatter.transferTimestamp(authInfo.day_completed.sunrise_ts, authInfo.timezone)
-        //     var start = new Date(newT)
-        //     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;
-        //     return <Rings common={common} bgRing={bgRing} targetRing={realRingBig} canvasId={'ddddsss_day' + 'index_day'} />
-
-        // }
-
-        // if (authInfo && authInfo.timezone) {
-        //     now1 = TimeFormatter.transferTimestamp(now1, authInfo.timezone)
-        // }
-
-
-        // var sunRise = 6 * 60
-        // var sunSet = 18 * 60
-
-        // var sunRiseObj = user.isLogin ? dayStore.dayRingSunrise : '06:00:00'
-        // var sunSetObj = user.isLogin ? dayStore.dayRingSunset : '18:00:00'
-        // sunRise = parseInt(sunRiseObj.split(':')[0]) * 60 + parseInt(sunRiseObj.split(':')[1])
-        // sunSet = parseInt(sunSetObj.split(':')[0]) * 60 + parseInt(sunSetObj.split(':')[1])
-
-
-        // var duration = sunSet - sunRise
-
-        // realRingBig.startArc = (sunRise * 60) / (24 * 3600) * 2 * Math.PI - Math.PI / 2.0;
-        // realRingBig.durationArc = (duration * 60) / (24 * 3600) * 2 * Math.PI;
-
-        // var currentDot = getDot(null, false)
-        // currentDot.offset = (authInfo && authInfo.timezone) ? TimeFormatter.timeZoneOffset(authInfo.timezone) : 0
-        // var date = new Date()
-        // var minutes = date.getHours() * 60 + date.getMinutes()
-        // if (minutes < sunRise) {
-        //     minutes += 1440
-        // }
-
-        // currentDot.color = ColorType.day
-
-
-        // var now = new Date()
-        // now = localNow(now)
-        // var t = now.getHours() * 60 + now.getMinutes()
-        // var duration2 = t - sunRise
-        // if (duration2 < 0) {
-        //     duration2 += 24 * 60
-        // }
-        // var realRing: RealRing = {
-        //     color: ColorType.day,
-        //     startArc: (sunRise * 60) / (24 * 3600) * 2 * Math.PI - Math.PI / 2.0,
-        //     durationArc: (duration2 * 60) / (24 * 3600) * 2 * Math.PI
-        // }
-        // if (dayStore.dayRingDate) {
-        //     if (new Date(dayStore.dayRingDate).getDate() != now.getDate()) {
-        //         realRing = null;
-        //     }
-        // }
-
-        // // if (!user.isLogin) {
-        // //     currentDot = null
-        // //     realRing = null
-        // // }
-
-        // return <Rings common={common} bgRing={bgRing} targetRing={realRingBig} realRing={duration2 <= duration ? realRing : null} currentDot={currentDot} canvasId={'day_day2'} />
-
     }
 
     function getSunsetDuration() {