mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-09 09:00:34 +08:00
refactor(dateFilter): improve readability on conditional assignment
Use ternary operator instead of if statement Closes #5065
This commit is contained in:
committed by
Peter Bacon Darwin
parent
dbb21b1531
commit
856be44628
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user