Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 8c5cbcb

Browse files
dimircpetebacondarwin
authored andcommitted
refactor(dateFilter): improve readability on conditional assignment
Use ternary operator instead of if statement Closes #5065
1 parent 78d2620 commit 8c5cbcb

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/ng/filter/filters.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -425,11 +425,7 @@ function dateFilter($locale) {
425425
format = format || 'mediumDate';
426426
format = $locale.DATETIME_FORMATS[format] || format;
427427
if (isString(date)) {
428-
if (NUMBER_STRING.test(date)) {
429-
date = int(date);
430-
} else {
431-
date = jsonStringToDate(date);
432-
}
428+
date = NUMBER_STRING.test(date) ? int(date) : jsonStringToDate(date);
433429
}
434430

435431
if (isNumber(date)) {

0 commit comments

Comments
 (0)