From a1322873c8d3c1babc5d5c04f8c79e741195ede1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Werlang?= Date: Mon, 5 Dec 2016 16:26:59 -0200 Subject: [PATCH] fix(facade): cache original format string (#12764) --- modules/@angular/facade/src/intl.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/@angular/facade/src/intl.ts b/modules/@angular/facade/src/intl.ts index eb164913ac..c9bad05171 100644 --- a/modules/@angular/facade/src/intl.ts +++ b/modules/@angular/facade/src/intl.ts @@ -187,7 +187,8 @@ function dateFormatter(format: string, date: Date, locale: string): string { if (fn) return fn(date, locale); - let parts = DATE_FORMATTER_CACHE.get(format); + const cacheKey = format; + let parts = DATE_FORMATTER_CACHE.get(cacheKey); if (!parts) { parts = []; @@ -205,7 +206,7 @@ function dateFormatter(format: string, date: Date, locale: string): string { } } - DATE_FORMATTER_CACHE.set(format, parts); + DATE_FORMATTER_CACHE.set(cacheKey, parts); } return parts.reduce((text, part) => {