I have a data array which has a date attribute, I need to filter the data based on date.
I am using dstorejs to store the data as below
this.employeeStore = new Memory({data:[emplist],idProperty:"emp_num"});
I need to make a filter based on employee's joining date , like who joined from 1st of Jan 2014 till 3rd of March 2015
this.employeeStore.filter({joinDate:'01/01/2014'});
This gives all employees who joined on 1st of Jan 2014 but if I need to filter in a range like
this.employeeStore.filter.gte({joinDate:'01/01/2014'});
This will not work because it is not a number, it is a string or date object
To achieve this do I need to write the custom store as they mentioned in tutorial?
Is there any other way of doing this?
Or is there any other framework like dstore to achieve this ?
You can achieve this just by using
dojo/storeQuery filter , exactly query with callback function to manage comparing dateand also using the
dojo/datecomparefunction to compare date of your emplist array to a specific date like below :you can see a Fiddle to have a better understanding .