refactor(dateFilter): improve readability on conditional assignment

Use ternary operator instead of if statement

Closes #5065
This commit is contained in:
Wladimir Coka
2013-11-21 16:34:50 -05:00
committed by Peter Bacon Darwin
parent dbb21b1531
commit 856be44628

View File

@@ -395,11 +395,7 @@ function dateFilter($locale) {
format = format || 'mediumDate';
format = $locale.DATETIME_FORMATS[format] || format;
if (isString(date)) {
if (NUMBER_STRING.test(date)) {
date = int(date);
} else {
date = jsonStringToDate(date);
}
date = NUMBER_STRING.test(date) ? int(date) : jsonStringToDate(date);
}
if (isNumber(date)) {