diff options
| author | siwalikm <[email protected]> | 2018-11-17 14:02:22 +0530 |
|---|---|---|
| committer | siwalikm <[email protected]> | 2018-11-17 14:02:22 +0530 |
| commit | 89edd15c5d0ccb90426e107dd078d9d64ca84399 (patch) | |
| tree | cb215837166379b1160d28f1981c51bd651f3cb9 /lib | |
| parent | c63ac00c2cca2062ce733851f7239ed8db3ad00a (diff) | |
| download | faker-89edd15c5d0ccb90426e107dd078d9d64ca84399.tar.xz faker-89edd15c5d0ccb90426e107dd078d9d64ca84399.zip | |
adding test cases
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/time.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/time.js b/lib/time.js index 51f7a28f..580d33ee 100644 --- a/lib/time.js +++ b/lib/time.js @@ -11,7 +11,11 @@ var _Time = function(faker) { * @method faker.time.recent * @param {string} outputType - 'abbr' || 'wide' || 'unix' (default choice) */ - self.recent = function(outputType = "unix") { + self.recent = function(outputType) { + if (typeof outputType === "undefined") { + outputType = 'unix'; + } + var date = new Date(); switch (outputType) { case "abbr": @@ -21,7 +25,6 @@ var _Time = function(faker) { date = date.toTimeString(); break; case "unix": - default: date = date.getTime(); break; } |
