Commit Graph
14 Commits
Author SHA1 Message Date
Ben West 48d1ae399b tweak tests/logging 2023-01-27 08:07:29 -08:00
Ben West 10dd236cda daytoday: Align start of day with data across zones
This change correctly aligns the name of the day in the
current zone with the start of the data for the
equivalent day in the profile's zone.  This makes it so
that viewing a day to day report in any timezone works
going both east and west directions.
2023-01-26 12:52:32 -08:00
Ben West f6b2d4f717 Revert "Revert "clock at the end of the day is 23:59:59.999""
This reverts commit a4f92713c4.
2023-01-26 11:43:43 -08:00
Ben West a4f92713c4 Revert "clock at the end of the day is 23:59:59.999"
This reverts commit f51fac9623.
2023-01-26 11:42:36 -08:00
Ben West 0ee0712ca7 redact console log lines 2023-01-24 10:59:40 -08:00
Ben West f51fac9623 clock at the end of the day is 23:59:59.999
Ensure that the test fixtures will return; the previous changes
correctly forward the time to end of day across zones and
datelines.  One side effect  is that the date formatted for the end
of the day uses all the microseconds for the day as well.  This
changes the query from the form of 23:59:59.000Z to 23:59:59.999Z.
This also ensures that anything that happens during that one second
will be included rather than excluded.
2023-01-24 09:56:49 -08:00
Ben West 8983713b74 ensure daily reports dates translate to profile timezone
To illustrate the difference, I used chrome "sensors" feature to change my
timezone to one that spans the dateline.

    > moment.tz('2023-01-19', 'America/Los_Angeles').endOf('day').format( )
    '2023-01-19T23:59:59-08:00'
    > moment.tz(moment('2023-01-19'), 'America/Los_Angeles').endOf('day').format( )
    '2023-01-18T23:59:59-08:00'

The old code uses a string replacement, which is equivalent to the first
test.  This causes the dates on the reports to be off by one, as well as
risks the data wrapping around the dateline so it can't be seen.  For example,
replacing "23:59:59" with "00:00:00" in the first example doesn't correctly
wrap around the dateline.

The patch introduces a way to parse the dates requested in the browser's
time zone, and then translates them to the profile's timezone.  The
difference is shown in the second example above.  With this change, the
correct date label should be rendered, and the data should start at
midnight without wrapping around the dateline.
2023-01-24 09:56:49 -08:00
Ben West 0330e13e33 ensure timezones assigned once in daily reports
This fixes the label on the days in the daytoday charts.  Passing a moment
object that is already zoned prevents toLocaleDateString from reinterpreting
the zone information when the date is already relative to the profile.

This also ensures that the datefilter is adjusted to the profile's zone rather
than truncating the time to the end or beginning of the day.  This should
prevent incorrectly wrapping arounnd the dateline.
2023-01-24 09:56:49 -08:00
Sulka HaroandGitHub 3a0629578e Refactor moment to be loaded from ctx (#7331)
* Experimental branch that replaces momentjs with dayjs in the client

* Revert unintentional change

* feat

* Turns out dayjs is a no-go, but this has some good restructuring so submitting that
2023-01-01 19:14:59 +02:00
6643eb9c20 Added a specific rendering for BG Check events on the Day to Day report. (#6530)
Added an option to hide BG Check and other events on the Day to Day report.

Co-authored-by: Sulka Haro <sulka@sulka.net>
2021-02-02 19:23:08 +02:00
d51a6745a3 #6701 Save report preferences (#6761)
Proof of concept to demonstrate saving report preferences

Co-authored-by: Sulka Haro <sulka@sulka.net>
2021-01-26 21:42:26 +02:00
Sulka HaroandGitHub 647ed20de1 Clean statics & bundle more (#6745)
* * Remove unused old version of MFB
* Bundle food, profile editor
* Clean up the static folders

* Fix tests
2021-01-17 12:20:48 +02:00
Sulka Haro edfcf6eccd Fix authorization renewal 2020-12-21 21:09:18 +02:00
Sulka Haro c12ad765be * Refactor how the levels dependency is loaded, to fix some localization issues
* Moves reporting client to the bundles
2020-12-14 20:31:20 +02:00