Open sebbASF opened 7 years ago
The date range calculations currently work out the end of the month. This involves leap-year calculations and a table of days in each month.
It would be simpler to express the date range as gte=YYYY/MM/01 00:00:00 lt=YYYY'/MM'/01 00:00:00 where MM' is MM+1 unless MM=12 etc.
Also, rather than using the string date field, it would likely be more efficient to use the epoch.
This affects mbox.lua and stats.lua which both have copies of the code
Using the epoch would be tricky for relative dates such as "less than 2 months ago" which are currently handled by the ES database.
The date range calculations currently work out the end of the month. This involves leap-year calculations and a table of days in each month.
It would be simpler to express the date range as gte=YYYY/MM/01 00:00:00 lt=YYYY'/MM'/01 00:00:00 where MM' is MM+1 unless MM=12 etc.
Also, rather than using the string date field, it would likely be more efficient to use the epoch.