Improve var names
This commit is contained in:
+4
-4
@@ -23,12 +23,12 @@ export default class CycleChart extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
columns: makeColumnInfo(config.cycleDaysToShow)
|
||||
columns: makeColumnInfo(config.xAxisRangeInDays)
|
||||
}
|
||||
|
||||
this.reCalculateChartInfo = (function(Chart) {
|
||||
return function() {
|
||||
Chart.setState({columns: makeColumnInfo(config.cycleDaysToShow)})
|
||||
Chart.setState({columns: makeColumnInfo(config.xAxisRangeInDays)})
|
||||
}
|
||||
})(this)
|
||||
|
||||
@@ -176,9 +176,9 @@ function makeColumnInfo(n) {
|
||||
function getPreviousDays(n) {
|
||||
const today = new Date()
|
||||
today.setHours(0); today.setMinutes(0); today.setSeconds(0); today.setMilliseconds(0)
|
||||
const twoWeeksAgo = new Date(today - (range.DAY * n))
|
||||
const earlierDate = new Date(today - (range.DAY * n))
|
||||
|
||||
return range(twoWeeksAgo, today).reverse()
|
||||
return range(earlierDate, today).reverse()
|
||||
}
|
||||
|
||||
function normalizeToScale(temp) {
|
||||
|
||||
@@ -5,7 +5,7 @@ const config = {
|
||||
low: 33,
|
||||
high: 40
|
||||
},
|
||||
cycleDaysToShow: 40,
|
||||
xAxisRangeInDays: 40
|
||||
}
|
||||
|
||||
const margin = 3
|
||||
|
||||
Reference in New Issue
Block a user