...
 
Commits (5)
    https://gitcode.net/dcloud/hello-uts/-/commit/2d25f4c9909e9ea5c27c9b0678602e768ff82261 Date.toXString 示例完善 2024-04-18T12:55:00+08:00 duqingquan duqingquan@dcloud.io https://gitcode.net/dcloud/hello-uts/-/commit/6f2df66d4a0ec3119a60bd3d3208f25f70515453 调整date测试例 2024-04-19T17:09:25+08:00 m0_75226990 lizhongyi@dcloud.io https://gitcode.net/dcloud/hello-uts/-/commit/2893e5719f420078ebd8e0ac31c72e0c69306de9 调整 date.toXString 测试示例 2024-04-19T20:02:39+08:00 duqingquan duqingquan@dcloud.io https://gitcode.net/dcloud/hello-uts/-/commit/caefc89249a128acce54f001d4776d26b607e6bc Date.toXString 示例调整 2024-04-19T20:13:56+08:00 duqingquan duqingquan@dcloud.io https://gitcode.net/dcloud/hello-uts/-/commit/b5165042d5cdeec35a3b100a4c49b5139a571297 解决Date 示例冲突 2024-04-19T20:15:48+08:00 duqingquan duqingquan@dcloud.io
......@@ -49,22 +49,18 @@ export function testDate() : Result {
test('toXString', () => {
// #ifdef APP-ANDROID
const event = new Date('1995-12-17T03:24:00');
// #ifndef APP-ANDROID
expect(event.toString()).toEqual("Sun Dec 17 1995 03:24:00 GMT+0800");
expect(event.toTimeString()).toEqual("03:24:00 GMT+0800");
// #endif
expect(event.toISOString()).toEqual("1995-12-16T19:24:00.000Z");
expect(event.toJSON()).toEqual("1995-12-16T19:24:00.000Z");
expect(event.toDateString()).toEqual("Sun Dec 17 1995");
const event2 = new Date('2014-01-09 22:00:00');
// #ifndef APP-ANDROID
expect(event2.toString()).toEqual("Thu Jan 09 2014 22:00:00 GMT+0800");
expect(event2.toTimeString()).toEqual("2014-01-09T14:00:00.000Z");
// #endif
expect(event2.toTimeString()).toEqual("22:00:00 GMT+0800");
expect(event2.toISOString()).toEqual("2014-01-09T14:00:00.000Z");
expect(event2.toJSON()).toEqual("Thu Jan 09 2014");
expect(event2.toDateString()).toEqual("22:00:00 GMT+0800");
expect(event2.toJSON()).toEqual("2014-01-09T14:00:00.000Z");
expect(event2.toDateString()).toEqual("Thu Jan 09 2014");
// #endif
})
......