Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DateInput displays invalid date string #28

Open
dandelany opened this issue Mar 6, 2020 · 0 comments
Open

DateInput displays invalid date string #28

dandelany opened this issue Mar 6, 2020 · 0 comments

Comments

@dandelany
Copy link

DateInput supposedly takes either an ISO date string or a JS Date object. No matter what I give it, however, the placeholder string is completely wrong - seems like an issue with whatever is parsing/constructing strings. eg.:

const Demo = () => (
  <DateInput
    defaultValue={new Date("2018-01-08T15:44:30.000Z")}
    placeholder='DD/MM/YYYY'
  />
);
render(<Demo />);  

displays this incorrect date string:

image

and passing it as an ISO string:

const Demo = () => (
  <DateInput
    defaultValue={"2018-01-08T15:44:30.000Z"}
    placeholder='DD/MM/YYYY'
  />
);
render(<Demo />);  

yields a different but also incorrect result:

image

(in both cases, i expect 01/08/2018 to display. I'm using this demo page to test: https://grommet-nextjs.herokuapp.com/examples/grommet-controls/DateInput/_starter )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant