Dear Sander, Nope... my bad. Im sorry. Your suggested query - 'queryDate.toISOString().split('T')[0]' takes care of things. Your solution is absolutely perfect. I fumbled on the rendering part at my end. Thanks for the solution again.
On Friday, February 8, 2019 at 5:04:09 AM UTC-6, rj wrote: > > Hi Sander, > > I did the below changes. The filtering operation is working. Thank you. > However, when i enter a date on the input field, it is getting read as a > different date when it goes into the component. > Example - When i enter "28-01-2019", the argument passed to the component > event handler is "Sun Jan 27 2019 18:00:00 GMT-0600 (Central Standard > Time)". Because of this i am not able to see the results for the entered > date. > > I am expecting the below results to show up - > > 2019-01-28T01:26:12.738Z > > 2019-01-28T01:27:11.535Z > > 2019-01-28T01:19:15.341Z > > 2019-01-28T01:20:06.529Z > > > But i am receiving 0 results. > > > On Friday, February 8, 2019 at 4:40:25 AM UTC-6, Sander Elias wrote: >> >> Hi Rohit, >> >> change this in your template: >> >> (change)="filterDate(queryDate.valueAsDate)" >> >> and this in your controller: >> >> this.venues.filter(v => >> v.datecreated.includes(queryDate.toISOString().split('T')[0])) : >> >> Should do it, perhaps it needs a little tlc. >> >> Regards >> Sander >> >> > On Friday, February 8, 2019 at 5:04:09 AM UTC-6, rj wrote: > > Hi Sander, > > I did the below changes. The filtering operation is working. Thank you. > However, when i enter a date on the input field, it is getting read as a > different date when it goes into the component. > Example - When i enter "28-01-2019", the argument passed to the component > event handler is "Sun Jan 27 2019 18:00:00 GMT-0600 (Central Standard > Time)". Because of this i am not able to see the results for the entered > date. > > I am expecting the below results to show up - > > 2019-01-28T01:26:12.738Z > > 2019-01-28T01:27:11.535Z > > 2019-01-28T01:19:15.341Z > > 2019-01-28T01:20:06.529Z > > > But i am receiving 0 results. > > > On Friday, February 8, 2019 at 4:40:25 AM UTC-6, Sander Elias wrote: >> >> Hi Rohit, >> >> change this in your template: >> >> (change)="filterDate(queryDate.valueAsDate)" >> >> and this in your controller: >> >> this.venues.filter(v => >> v.datecreated.includes(queryDate.toISOString().split('T')[0])) : >> >> Should do it, perhaps it needs a little tlc. >> >> Regards >> Sander >> >> > -- You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group. To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscr...@googlegroups.com. To post to this group, send email to angular@googlegroups.com. Visit this group at https://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.