From 37d9424ec8c3751b775bd70bce1becfb53eef8a2 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sun, 2 Feb 2014 08:59:45 +0000 Subject: [PATCH] only call date function if needed in Ox.formatDate --- source/Ox/js/Format.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/Ox/js/Format.js b/source/Ox/js/Format.js index 95460b9a..d3049f35 100644 --- a/source/Ox/js/Format.js +++ b/source/Ox/js/Format.js @@ -348,7 +348,9 @@ Ox.formatDate Formats a date according to a format string } date = Ox.makeDate(date); format.forEach(function(value) { - string = string.replace(value[0], value[1](date, utc)); + string = string.replace(value[0], function() { + return value[1](date, utc); + }); }); return string; };