Skip to content

Faker date formatting not as expected #392

@adriendengreville

Description

@adriendengreville

Describe the bug
When using the {{faker 'date.recent'}} helper, the expected result is something like "2020-12-24T03:06:43.847Z" (as explained in Faker.js' doc) but I'm getting something like Thu Dec 24 2020 14:22:55 GMT+0100 (Central European Standard Time).

To Reproduce
Use a template like this one :

{
  "date": "{{ faker 'date.recent'}}"
}

Expected behavior
I'm expecting an ISO formatted date as vanilla Faker.js would provide it, not a reformatted one.

Screenshots
This is the result with the faker helper :
image
This is what I'm expecting, and that I get when using this workaround : {{date '2019' '2020' "yyyy-MM-d'T'HH:mm:ss'Z'"}}
image

Mockoon version:
1.11.0

OS / OS version:
Mac OS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions