From 58f5c3fee82a5f48eb6b02349f35ecf3f9133327 Mon Sep 17 00:00:00 2001 From: Kevin Jin Date: Sun, 27 Sep 2015 11:03:32 -0400 Subject: [PATCH] Support literal percent sign By the spec for strftime(3), '%%' in the format string should be replaced with '%' in the resultString. --- strftime.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/strftime.js b/strftime.js index 8deb8b1..a3420f2 100644 --- a/strftime.js +++ b/strftime.js @@ -227,6 +227,12 @@ // Examples for new Date(0) in GMT + // '%' + // case '%': + case 37: + resultString += '%'; + break; + // 'Thursday' // case 'A': case 65: