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

Parse 'moment' and raw ISO string dates in datepicker #2976

Closed
jdk339 opened this issue Nov 8, 2018 · 6 comments
Closed

Parse 'moment' and raw ISO string dates in datepicker #2976

jdk339 opened this issue Nov 8, 2018 · 6 comments
Assignees
Labels

Comments

@jdk339
Copy link

jdk339 commented Nov 8, 2018

Feature Request

It would be great if the igx-date-picker component could read both ISO date strings and 'moment' objects. Currently, I have to do something like the following:

this.payPeriods = payPeriods.map((pp: any) => {
    pp.startDate = pp.startDate ? new Date(pp.startDate) : null;
    return pp;
});

Also, the problem with this is that new Date() does not always parse strings properly, so if igx-date-picker could parse ISO strings it would help out a lot.

@bkulov
Copy link
Contributor

bkulov commented Dec 19, 2018

We're currently working on implementing an input in the date picker so the user could manually enter dates. This is the spec:
https://github.com/IgniteUI/igniteui-angular/wiki/igx-datePicker-Specification

Related issue is #3034.

We will support various ISO date formats. For more details see the spec above.

@bkulov
Copy link
Contributor

bkulov commented Dec 19, 2018

@jdk339 We don't have immediate plans to support moment library.

@jdk339
Copy link
Author

jdk339 commented Dec 19, 2018

@bkulov Okay thanks, at least ISO strings will be supported.

@bkulov
Copy link
Contributor

bkulov commented Dec 20, 2018

@jdk339 Could you please provide us a few examples of strings which could not be properly parsed by new Date() so we could test if igx-date-picker is parsing them correctly?

@jdk339
Copy link
Author

jdk339 commented Dec 20, 2018

@bkulov 2019-03-28T00:00:00 and any numerical variation of that format

@bkulov bkulov added 🛠️ status: in-development Issues and PRs with active development on them and removed 🆕 status: new labels Jan 11, 2019
@sboykova
Copy link
Contributor

Hello jdk339,
igx-date-picker parses correctly new Date('2019-03-28T00:00:00') and displays it. With the current release, it will be possible to edit such dates as well.

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

No branches or pull requests

5 participants