mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-23 15:19:38 +02:00
Match Plaid holding values on current day (#2212)
* Match Plaid holding values on current day * Fix chart timezone issue * Add timezone tests for syncs * Hide sidebars on trades test
This commit is contained in:
parent
470b753833
commit
2000f05453
16 changed files with 242 additions and 21 deletions
|
@ -1,6 +1,8 @@
|
|||
import { Controller } from "@hotwired/stimulus";
|
||||
import * as d3 from "d3";
|
||||
|
||||
const parseLocalDate = d3.timeParse("%Y-%m-%d");
|
||||
|
||||
export default class extends Controller {
|
||||
static values = {
|
||||
data: Object,
|
||||
|
@ -51,10 +53,12 @@ export default class extends Controller {
|
|||
|
||||
_normalizeDataPoints() {
|
||||
this._normalDataPoints = (this.dataValue.values || []).map((d) => ({
|
||||
date: new Date(`${d.date}T00:00:00Z`),
|
||||
date: parseLocalDate(d.date),
|
||||
date_formatted: d.date_formatted,
|
||||
trend: d.trend,
|
||||
}));
|
||||
|
||||
console.log(this._normalDataPoints);
|
||||
}
|
||||
|
||||
_rememberInitialContainerSize() {
|
||||
|
@ -185,7 +189,7 @@ export default class extends Controller {
|
|||
this._normalDataPoints[this._normalDataPoints.length - 1].date,
|
||||
])
|
||||
.tickSize(0)
|
||||
.tickFormat(d3.utcFormat("%b %d, %Y")),
|
||||
.tickFormat(d3.timeFormat("%b %d, %Y")),
|
||||
)
|
||||
.select(".domain")
|
||||
.remove();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue