Parse 'moment' and raw ISO string dates in datepicker
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.
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.
@jdk339 We don't have immediate plans to support moment library.
@bkulov Okay thanks, at least ISO strings will be supported.
@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?
@bkulov 2019-03-28T00:00:00 and any numerical variation of that format
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.