Skip to content
This repository has been archived by the owner on Jan 14, 2021. It is now read-only.

DateTime should be mapped to Date #260

Closed
nikolasburk opened this issue Oct 15, 2019 · 0 comments
Closed

DateTime should be mapped to Date #260

nikolasburk opened this issue Oct 15, 2019 · 0 comments
Assignees
Labels
kind/improvement An improvement to existing feature and code.
Milestone

Comments

@nikolasburk
Copy link
Member

nikolasburk commented Oct 15, 2019

This issue makes the problem described in this issue actionable, namely that DateTime from the Prisma schema should be mapped to the Date type in JS/TS, e.g:

model Post {
  id        String   @default(cuid()) @id @unique
  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt
  published Boolean
  title     String
  content   String?
  author    User?
}

should become:

export declare type Post = {
    id: string;
    createdAt: Date;
    updatedAt: Date;
    published: boolean;
    title: string;
    content: string | null;
}
@schickling schickling added this to the Preview 15 milestone Oct 16, 2019
@schickling schickling added the bug/2-confirmed We have confirmed that this is a bug. label Oct 16, 2019
@janpio janpio added the kind/bug A reported bug. label Oct 16, 2019
@timsuchanek timsuchanek added kind/improvement An improvement to existing feature and code. and removed bug/2-confirmed We have confirmed that this is a bug. kind/bug A reported bug. labels Oct 16, 2019
jednano pushed a commit to jednano/photonjs that referenced this issue Nov 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/improvement An improvement to existing feature and code.
Projects
None yet
Development

No branches or pull requests

4 participants