Commit Graph

11 Commits (con-cache-patch-test)

Author SHA1 Message Date
hq1 e467324c5a
Disallow small intervals on large ranges (#3245)
* Update interval dropdown based on custom range selection

* Add `monthsBetweenDates` function

* Reassign interval for custom "period" based on local storage

* Generate intervals by period based on stats_start_date

* Account for "custom" and "all" period intervals dynamically
3 years ago
Vini Brasil 0cfbcedd84
Fix date picker shifting day bug (#2848)
* Fix date picker shifting day bug

This commit fixes a bug where picking a specific date in custom range
takes you to the stats of the day before.

This was caused because Flatpickr returns a Date instance, and we were
trying to parse this Date instance into day.js using the `utc` function,
assuming it was a ISO-8601 string.

This commit fixes it by casting Date into dayjs using the `dayjs`
function instead of `utc`.

* Fix invalid date Flatpickr bug

This commit fixes a bug where the Flatpickr was not setting the minDate
correctly based on statsBegin. This was failing because parseUTCDate is
now returning a day.js instance, and Flatpickr cannot handle that type.

* Hide dayjs usage in util/date
4 years ago
Vini Brasil 9f036d3915
Show detailed comparison dates in top stats (#2804)
* Pass comparison_query as argument to top stats functions

* Add comparison values and dates to top stats API

* Display comparison dates and values in top stats

* Rename function to renderPercentageComparison

* Create component to do conditional rendering

* DRY date range formatting function

---------

Co-authored-by: Uku Taht <uku.taht@gmail.com>
4 years ago
Uku Taht e672ea66ec
Frontend timezone issues (#2810)
* Use dayjs with UTC plugin for date-formatter

* Remove 'toHuman' function

* Use dayjs dates in Datepicker component

* Use util/date.js functions in date formatter

* Remove `fromJSDate`

* Use formatISO instead of raw dayjs formatter
4 years ago
Vini Brasil 87a63fe28a
Custom comparison mode (#2753)
This commit implements the custom comparison mode using a date range.
4 years ago
Vignesh Joglekar 9279cd7554
Fixes inane Safari Date.parse compatibility issue (#1887)
* Safari is modern IE

* Adds proper support for realtime "dateString"
5 years ago
Uku Taht d40faf6ec7 More datepicker improvements 5 years ago
Uku Taht f9ab9ef980 Fix arrows on year period 5 years ago
Uku Taht 7f58e6be4e Add Year to Date option in datepicker 5 years ago
Uku Taht 0e908c84f6 Show weekday and year in datepicker when relevant 5 years ago
Uku Taht 47fac2350f
Use generic ListReport for pages (#1505) 5 years ago