Skip to content

Commit

Permalink
✨ 使用 Date 对象代替时间戳
Browse files Browse the repository at this point in the history
  • Loading branch information
WOSHIZHAZHA120 committed May 9, 2024
1 parent f4aa7cb commit 0c47545
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/info-tr-chart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ const option = computed<ChartOption>(() => {
{
data: props.data.map(data => {
return [
data.record_at,
+data.record_at,
Number(
Number(data.tr).toFixed(2)
)
Expand Down
6 changes: 3 additions & 3 deletions src/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,20 +108,20 @@ const test_tetrio_info = () => {
date.setDate(date.getDate() - index - 1)
return {
record_at: +date,
record_at: date,
tr: random(tr - tr_chart_offset_range, tr + tr_chart_offset_range)
}
}).reverse(),
{
record_at: Date.now(),
record_at: new Date(),
tr
}
].map(data => {
const date = new Date(data.record_at)
date.setHours(0)
date.setMinutes(0)
date.setSeconds(0)
data.record_at = +date
data.record_at = date
return data
})
Expand Down

0 comments on commit 0c47545

Please sign in to comment.