fix time zone bug

unit-test
Pan 2018-07-17 12:32:35 +08:00
parent 4320647061
commit 828f8117e8
2 changed files with 2 additions and 2 deletions

View File

@ -1,7 +1,7 @@
import { formatTime } from '@/utils/index.js'
describe('Utils:formatTime', () => {
const d = new Date(1531475641067) // "2018-07-13 17:54:01"
const d = new Date('2018-07-13 17:54:01') // "2018-07-13 17:54:01"
it('test now', () => {
expect(formatTime(+new Date() - 1)).toBe('刚刚')

View File

@ -1,7 +1,7 @@
import { parseTime } from '@/utils/index.js'
describe('Utils:parseTime', () => {
const d = new Date(1531475641067) // "2018-07-13 17:54:01"
const d = new Date('2018-07-13 17:54:01') // "2018-07-13 17:54:01"
it('timestamp', () => {
expect(parseTime(d)).toBe('2018-07-13 17:54:01')
})