mirror of
https://github.com/gwenhael-le-moine/credger.git
synced 2024-12-26 09:58:36 +01:00
granularity isn't what you think it is
This commit is contained in:
parent
5151b2fc79
commit
53bc76aeab
1 changed files with 12 additions and 12 deletions
|
@ -94,19 +94,19 @@
|
||||||
Controls.period.set( current_period );
|
Controls.period.set( current_period );
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
granularity: {
|
/* granularity: {
|
||||||
set: ( value ) => {
|
* set: ( value ) => {
|
||||||
if ( !isNaN( parseInt( value ) ) ) {
|
* if ( !isNaN( parseInt( value ) ) ) {
|
||||||
granularity = parseInt( value );
|
* granularity = parseInt( value );
|
||||||
|
|
||||||
monthly();
|
* monthly();
|
||||||
}
|
* }
|
||||||
}
|
* }
|
||||||
}
|
* } */
|
||||||
};
|
};
|
||||||
|
|
||||||
const monthly = () => {
|
const monthly = () => {
|
||||||
API.balance( current_period.toISOString().split("T")[0].slice( 0, -3 ), ["Expenses"].join(" "), granularity )
|
API.balance( current_period.toISOString().split("T")[0].slice( 0, -3 ), ["Expenses"].join(" "), 999 )
|
||||||
.then( balance => {
|
.then( balance => {
|
||||||
const total = balance.reduce( (memo, line) => memo + line.amount, 0 );
|
const total = balance.reduce( (memo, line) => memo + line.amount, 0 );
|
||||||
|
|
||||||
|
@ -130,9 +130,9 @@
|
||||||
<button onclick="Controls.period.next()">+</button>
|
<button onclick="Controls.period.next()">+</button>
|
||||||
<h3 id="display"></h3>
|
<h3 id="display"></h3>
|
||||||
</div>
|
</div>
|
||||||
<div id="granularity">
|
<!-- <div id="granularity">
|
||||||
<input oninput="Controls.granularity.set( this.value );">
|
<input oninput="Controls.granularity.set( this.value );">
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
<div id="month">
|
<div id="month">
|
||||||
<div id="donut" style="height: 256; width: 256;"></div>
|
<div id="donut" style="height: 256; width: 256;"></div>
|
||||||
|
|
Loading…
Reference in a new issue