diff options
| author | Piotr Kuczynski <[email protected]> | 2022-01-25 09:45:35 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-01-25 09:45:35 +0100 |
| commit | 0f1ca0d72f7bbb448832ca13b0ad84387f8409a6 (patch) | |
| tree | 3a52032491b3b24992b140f0ebf7271f24df1fd1 /src | |
| parent | 132e8c3d7c173a6c9708f865e8c7d6c31f9c6e55 (diff) | |
| download | faker-0f1ca0d72f7bbb448832ca13b0ad84387f8409a6.tar.xz faker-0f1ca0d72f7bbb448832ca13b0ad84387f8409a6.zip | |
chore: fix JSDoc comments in time.ts (#288)
Diffstat (limited to 'src')
| -rw-r--r-- | src/time.ts | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/time.ts b/src/time.ts index cf5190e6..cae55621 100644 --- a/src/time.ts +++ b/src/time.ts @@ -1,16 +1,21 @@ export class Time { /** - * recent + * Returns recent time * - * @method faker.time.recent - * @param outputType 'abbr' || 'wide' || 'unix' (default choice) + * @param format 'abbr' || 'wide' || 'unix' (default) + * + * @example + * faker.time.recent() // 1643067231856 + * faker.time.recent('abbr') // '12:34:07 AM' + * faker.time.recent('wide') // '00:34:11 GMT+0100 (Central European Standard Time)' + * faker.time.recent('unix') // 1643067231856 */ - recent(outputType: 'abbr' | 'wide' | 'unix' = 'unix'): string | number { + recent(format: 'abbr' | 'wide' | 'unix' = 'unix'): string | number { // TODO @Shinigami92 2022-01-11: This is not non-deterministic // https://github.com/faker-js/faker/pull/74/files#r781579842 let date: string | number | Date = new Date(); - switch (outputType) { + switch (format) { case 'abbr': date = date.toLocaleTimeString(); break; |
