Skip to content
This repository was archived by the owner on Mar 2, 2018. It is now read-only.

Commit 537b9c9

Browse files
committed
corrected null-check of moment with typeof
1 parent a7ace4a commit 537b9c9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/datetime.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export class NguiDatetime {
7777
ret = d.getFullYear() + '-' + pad0(d.getMonth() + 1) + '-' + pad0(d.getDate());
7878
ret += dateOnly ? '' : ' ' + pad0(d.getHours()) + ':' + pad0(d.getMinutes());
7979
return ret;
80-
} else if (d && moment) {
80+
} else if (d && typeof moment !== 'undefined') {
8181
return moment(d).format(format);
8282
} else {
8383
return '';

0 commit comments

Comments
 (0)