From fa50ca51d4f5950a6bc6639f5beef5bf133b1751 Mon Sep 17 00:00:00 2001 From: harttle Date: Sun, 23 Oct 2016 19:48:44 +0200 Subject: [PATCH] fix strftime test --- test/util/strftime.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/util/strftime.js b/test/util/strftime.js index 7cb3dfe24..060fdc54d 100644 --- a/test/util/strftime.js +++ b/test/util/strftime.js @@ -4,14 +4,16 @@ const expect = chai.expect; var t = require('../../src/util/strftime.js'); describe('util/strftime', function() { - var now = new Date('2016-10-23T16:15:23'); + var now = new Date('2016-10-24T00:15:23+08:00'); it('should format week by %U', function() { expect(t(now, '%U')).to.equal('43'); }); it('should format locale date string', function() { - expect(t(now, '%Y-%m-%d')).to.equal(now.toLocaleDateString()); + var date = now.toLocaleDateString('zh-CN'); + expect(t(now, '%Y-%m-%d')).to.equal(date); }); it('should format locale date string', function() { - expect(t(now, '%H:%M:%S')).to.equal(now.toLocaleTimeString()); + var time = now.toLocaleTimeString('zh-CN'); + expect(t(now, '%H:%M:%S')).to.equal(time); }); });