From f44ce424a8b2fb0b53f0c4aaca3ad216b2bcb863 Mon Sep 17 00:00:00 2001 From: Iskren Chernev Date: Fri, 27 Dec 2013 17:56:43 +0100 Subject: [PATCH] Workaround for safari bug --- test/moment/create.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/moment/create.js b/test/moment/create.js index 7c22208ed..6baf65f7b 100644 --- a/test/moment/create.js +++ b/test/moment/create.js @@ -746,8 +746,12 @@ exports.create = { //can parse other stuff too test.equal(moment('1999-W37-4 3:30', 'GGGG-[W]WW-E HH:mm').format('YYYY MM DD HH:mm'), '1999 09 16 03:30', "parsing weeks and hours"); - // Years less than 100 - ver('0098-06', 'GGGG-WW', "0098 02 03", "small years work", true); + // In safari, all years before 1300 are shifted back with one day. + // http://stackoverflow.com/questions/20768975/safari-subtracts-1-day-from-dates-before-1300 + if (new Date("1300-01-01").getUTCFullYear() === 1300) { + // Years less than 100 + ver('0098-06', 'GGGG-WW', "0098 02 03", "small years work", true); + } test.done(); }, -- 2.47.2