Skip to content

MapperUtils dateTransformer() returns '1970-01-01' when null is provided #3

@dbleakley

Description

@dbleakley

It looks like the dateTransforms may not be handling null or undefined input as expected.

Given the following test-case:

        expect(mapperUtils.dateTransformer(null)).to.be.undefined;

The dateTransformer returns '1970-01-01'.

Would it be reasonable to expect these transformers to return undefined in the event the input data is not truthy and/or possibly when the string is not a valid format -- moment(date_string).isValid === false?

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