Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wip/bewest/daytoday redo 03 #7857

Merged
merged 16 commits into from
Jan 28, 2023
Merged

Wip/bewest/daytoday redo 03 #7857

merged 16 commits into from
Jan 28, 2023

Commits on Jan 24, 2023

  1. daytoday reports are always in the profile's time zone

    Midnight for the profile should always be at the start of the
    day (midnight) for the chart.
    bewest committed Jan 24, 2023
    Configuration menu
    Copy the full SHA
    0541e2a View commit details
    Browse the repository at this point in the history
  2. pin start of day in profile's timezone

    This more closely mirrors logic in loopalyzer, as well as the intent from the
    surrounding code in reportclient.js.
    bewest committed Jan 24, 2023
    Configuration menu
    Copy the full SHA
    a47b367 View commit details
    Browse the repository at this point in the history
  3. 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.
    bewest committed Jan 24, 2023
    Configuration menu
    Copy the full SHA
    0330e13 View commit details
    Browse the repository at this point in the history
  4. 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.
    bewest committed Jan 24, 2023
    Configuration menu
    Copy the full SHA
    8983713 View commit details
    Browse the repository at this point in the history
  5. 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.
    bewest committed Jan 24, 2023
    Configuration menu
    Copy the full SHA
    f51fac9 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    6a543c8 View commit details
    Browse the repository at this point in the history
  7. redact console log lines

    bewest committed Jan 24, 2023
    Configuration menu
    Copy the full SHA
    0ee0712 View commit details
    Browse the repository at this point in the history
  8. Merge branch 'wip/bewest/daytoday-redo-03' of github.com:nightscout/c…

    …gm-remote-monitor into wip/bewest/daytoday-redo-03
    bewest committed Jan 24, 2023
    Configuration menu
    Copy the full SHA
    8e0ec88 View commit details
    Browse the repository at this point in the history

Commits on Jan 26, 2023

  1. Revert "clock at the end of the day is 23:59:59.999"

    This reverts commit f51fac9.
    bewest committed Jan 26, 2023
    Configuration menu
    Copy the full SHA
    a4f9271 View commit details
    Browse the repository at this point in the history
  2. Revert "Revert "clock at the end of the day is 23:59:59.999""

    This reverts commit a4f9271.
    bewest committed Jan 26, 2023
    Configuration menu
    Copy the full SHA
    f6b2d4f View commit details
    Browse the repository at this point in the history
  3. 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.
    bewest committed Jan 26, 2023
    Configuration menu
    Copy the full SHA
    10dd236 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    b376239 View commit details
    Browse the repository at this point in the history

Commits on Jan 27, 2023

  1. Configuration menu
    Copy the full SHA
    5d3268a View commit details
    Browse the repository at this point in the history
  2. tweak tests/logging

    bewest committed Jan 27, 2023
    Configuration menu
    Copy the full SHA
    48d1ae3 View commit details
    Browse the repository at this point in the history
  3. Merge branch 'wip/bewest/daytoday-redo-03' of github.com:nightscout/c…

    …gm-remote-monitor into wip/bewest/daytoday-redo-03
    bewest committed Jan 27, 2023
    Configuration menu
    Copy the full SHA
    664efe6 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a805939 View commit details
    Browse the repository at this point in the history