Improve var names

This commit is contained in:
Julia Friesel
2018-06-27 13:03:11 +02:00
parent 4a151ba0d1
commit ae39faaa72
2 changed files with 5 additions and 5 deletions
+4 -4
View File
@@ -23,12 +23,12 @@ export default class CycleChart extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
columns: makeColumnInfo(config.cycleDaysToShow) columns: makeColumnInfo(config.xAxisRangeInDays)
} }
this.reCalculateChartInfo = (function(Chart) { this.reCalculateChartInfo = (function(Chart) {
return function() { return function() {
Chart.setState({columns: makeColumnInfo(config.cycleDaysToShow)}) Chart.setState({columns: makeColumnInfo(config.xAxisRangeInDays)})
} }
})(this) })(this)
@@ -176,9 +176,9 @@ function makeColumnInfo(n) {
function getPreviousDays(n) { function getPreviousDays(n) {
const today = new Date() const today = new Date()
today.setHours(0); today.setMinutes(0); today.setSeconds(0); today.setMilliseconds(0) 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) { function normalizeToScale(temp) {
+1 -1
View File
@@ -5,7 +5,7 @@ const config = {
low: 33, low: 33,
high: 40 high: 40
}, },
cycleDaysToShow: 40, xAxisRangeInDays: 40
} }
const margin = 3 const margin = 3