提交 9b780ee8 编写于 作者: 杜庆泉's avatar 杜庆泉

新增 date valueof 示例

上级 7b9a606c
...@@ -10,6 +10,12 @@ export function testDate() : Result { ...@@ -10,6 +10,12 @@ export function testDate() : Result {
expect(secondsElapsed).toEqual(2); expect(secondsElapsed).toEqual(2);
}, 2000) }, 2000)
}) })
test('valueOf', () => {
const date1 = new Date('December 17, 1995 03:24:00');
expect(date1.valueOf()).toEqual(819141840000);
const date2 = new Date('1995-12-17T03:24:00');
expect(date2.valueOf()).toEqual(819141840000);
})
test('getDate', () => { test('getDate', () => {
const birthday = new Date('August 19, 1975 23:15:30'); const birthday = new Date('August 19, 1975 23:15:30');
const date1 = birthday.getDate(); const date1 = birthday.getDate();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册