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

Commit

Permalink
refactor(dateFilter): improve readability on conditional assignment
Browse files Browse the repository at this point in the history
Use ternary operator instead of if statement

Closes #5065
  • Loading branch information
dimirc authored and petebacondarwin committed Jul 15, 2014
1 parent 78d2620 commit 8c5cbcb
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/ng/filter/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -425,11 +425,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)) {
Expand Down

0 comments on commit 8c5cbcb

Please sign in to comment.