Skip to content

Commit

Permalink
兼容不同时区
Browse files Browse the repository at this point in the history
  • Loading branch information
silenty4ng committed Oct 27, 2024
1 parent 2fd7a16 commit b3a2c2c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/views/list/sat/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ onMounted(async ()=>{
state.alt = parseFloat(altRef.value.inputRef.modelValue || '0')
state.timer = setInterval(()=>{
state.dt = new Date().toLocaleString('zh-CN', { timeZone: 'Asia/Shanghai' })
state.dt = new Date().toLocaleString()
localStorage.setItem('myLng', state.lng.toString());
localStorage.setItem('myLat', state.lat.toString());
localStorage.setItem('myAlt', state.alt.toString());
Expand Down Expand Up @@ -342,7 +342,8 @@ const getPass = async () => {
sat_line_2: state.satData.find(e => e.name == state.sat).path[1],
lat: state.lat,
lng: state.lng,
alt: state.alt
alt: state.alt,
tz: Intl.DateTimeFormat().resolvedOptions().timeZone
})
})).json()
const passOption = []
Expand Down Expand Up @@ -394,7 +395,8 @@ const writeIt = async () => {
tx: state.tx,
rx: state.rx,
pass_time: state.pass.split('|')[0],
departure_time: state.pass.split('|')[1]
departure_time: state.pass.split('|')[1],
tz: Intl.DateTimeFormat().resolvedOptions().timeZone
})
})).json()
Expand Down

0 comments on commit b3a2c2c

Please sign in to comment.