fix time zone bug
parent
4320647061
commit
828f8117e8
|
@ -1,7 +1,7 @@
|
||||||
import { formatTime } from '@/utils/index.js'
|
import { formatTime } from '@/utils/index.js'
|
||||||
|
|
||||||
describe('Utils:formatTime', () => {
|
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', () => {
|
it('test now', () => {
|
||||||
expect(formatTime(+new Date() - 1)).toBe('刚刚')
|
expect(formatTime(+new Date() - 1)).toBe('刚刚')
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { parseTime } from '@/utils/index.js'
|
import { parseTime } from '@/utils/index.js'
|
||||||
|
|
||||||
describe('Utils:parseTime', () => {
|
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', () => {
|
it('timestamp', () => {
|
||||||
expect(parseTime(d)).toBe('2018-07-13 17:54:01')
|
expect(parseTime(d)).toBe('2018-07-13 17:54:01')
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue