Skip to content

Date columns aren't deserialized properly #179

Closed
@danelkhen

Description

Tested with sqlite driver only:

@Table()
export class MyRecord {
    @PrimaryColumn() key: string;
    @Column(CT.DATETIME, { nullable: true }) mtime: Date;
}

var x= {key:"gg", mtime:new Date()};
persist(x)

SQL

INSERT INTO "my_record"("key", "mtime") VALUES ($1,$2) -- PARAMETERS: ["gg","2017-1-9 11:50:4"]

2017-1-9 11:50:4 seems like a wrong value for the date parameter, But also after that - when loading the objects with typeorm the value of the property is of type string and not Date.

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions