alfajango / jquery-dynatable

A more-fun, semantic, alternative to datatables
http://www.dynatable.com
Other
2.78k stars 363 forks source link

Date Range Select And Dropdown By Using Date Column From Table #306

Open svszombie opened 5 years ago

svszombie commented 5 years ago

Hi, guys!

I use dynatable for statistics table from JSON. JSON gets data from mysql for last 30 days starting today, I can change that to more days for my purpose.. I have a column with dates in the m/d/Y format because I could not properly sort the d/m/Y format. Is it possible to create date range selection and today, yesterday, this week, last week, this month, last month, this year, last year, all time in a dropdown? What kind of querying should I be using? I tried different things, for example a search by defining input queries but I can't make the select option to have multiple values and I only managed to make today and yesterday because it searches for the particular date and yesterday is strtotime-1 day. Any ideas how to achieve search for multiple values for this? Another solution would be to use perPageDefault: [1,7,14,30...] and perPageOptions: [1,7,14,30...] in dataset but this is not what I was looking for because it displays the last 1, 7, 14 or 30 and so on rows (days), if I add more values. Hope it makes sense the way I explained it. Maybe it would make more sense to pass the date range request via get and request from database new date range then create new JSON from the new data based on range.

Any help highly appreciated!