Skip to content

Commit 828f811

Browse files
committed
fix time zone bug
1 parent 4320647 commit 828f811

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tests/unit/utils/formatTime.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { formatTime } from '@/utils/index.js'
22

33
describe('Utils:formatTime', () => {
4-
const d = new Date(1531475641067) // "2018-07-13 17:54:01"
4+
const d = new Date('2018-07-13 17:54:01') // "2018-07-13 17:54:01"
55

66
it('test now', () => {
77
expect(formatTime(+new Date() - 1)).toBe('刚刚')

tests/unit/utils/parseTime.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { parseTime } from '@/utils/index.js'
22

33
describe('Utils:parseTime', () => {
4-
const d = new Date(1531475641067) // "2018-07-13 17:54:01"
4+
const d = new Date('2018-07-13 17:54:01') // "2018-07-13 17:54:01"
55
it('timestamp', () => {
66
expect(parseTime(d)).toBe('2018-07-13 17:54:01')
77
})

0 commit comments

Comments
 (0)