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

Commit 856be44

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

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/ng/filter/filters.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -395,11 +395,7 @@ function dateFilter($locale) {
395395
format = format || 'mediumDate';
396396
format = $locale.DATETIME_FORMATS[format] || format;
397397
if (isString(date)) {
398-
if (NUMBER_STRING.test(date)) {
399-
date = int(date);
400-
} else {
401-
date = jsonStringToDate(date);
402-
}
398+
date = NUMBER_STRING.test(date) ? int(date) : jsonStringToDate(date);
403399
}
404400

405401
if (isNumber(date)) {

0 commit comments

Comments
 (0)